ButtonBar eXtended (with macro support)

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

Just a remark: You can change directory with WM_COPYDATA.
The same method lets you launch em commands.
More info:
http://ghisler.ch/board/viewtopic.php?t=12867&start=0&postdays=0&postorder=asc&highlight=wmcopydata
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

Thanks for the link.
Added em_commands in Version 0.3.
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

2Samuel,

Would there be a way to use this to delete a file (only if it exists) and then run a command?
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

Yes there is. But care for data loss, because there is no dialog box asking of its right to del. Also the file is deleted without paper bin.

WARNING: Deletes File under Cursor.

Use an ini entry like:

Code: Select all

[Button 15 Normal]
1_File=cmd.exe
1_Parameter=/c del %N
Needs_Parameters=1
2_Command=...
With confirmation use:

Code: Select all

[Button 15 Normal]
1_File=cmd.exe
1_Parameter=/c del /P %N
Needs_Parameters=1
2_Command=...
Last edited by Samuel on 2009-05-27, 05:40 UTC, edited 1 time in total.
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

Here's what I want to do. Right now I have this:

Code: Select all

[Button 2 Normal]
; Create (if not exist) or show (if exists) treeinfo.wc and refresh
1_Command=500
2_Command=540
I want to delete the treeinfo.wc file, if it exist, and recreate it on each root drive. What I have works if you manually delete the file first. Otherwise, it just shows the tree and refreshes it. If the refresh updates it to what is currently the actual tree, then I don't need to delete and re-create, just refresh. Does that make any sense?

Also, wil the command window pop-up in your code? I'd like to do it silently, if at all possible.
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

So this should work: (no popup)

Code: Select all

[Button 2 Normal]
1_File=cmd.exe
1_Parameter=/c del C:\treeinfo.wc
2_File=cmd.exe
2_Parameter=/c del D:\treeinfo.wc
3_File=cmd.exe
3_Parameter=/c del E:\treeinfo.wc
...
4_Command=500
5_Command=540
You need the 2 lines for every drive.
User avatar
nsp
Power Member
Power Member
Posts: 1804
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

Boofo wrote:.....
I want to delete the treeinfo.wc file, if it exist, and recreate it on each root drive. What I have works if you manually delete the file first.

Otherwise, it just shows the tree and refreshes it. If the refresh updates it to what is currently the actual tree, then I don't need to delete and re-create, just refresh. Does that make any sense?
....
[OT]
Why not using a batch file like "refresh all treeinfo.cmd"
from the batch file, you can delete the file if it do not exist and with TCMD you can refresh (Change to root drive, Show directory tree,r e-read source)


This will take a long time if you have big drives ! and will lock your TC for a wile !
[/OT]

An alternative is to create wc file with another application like XCD /treeinfo this will take time but will not lock TC ! This is not done silently but you will see which drive is processed an number of found folders...

I cannot guaranty you that everything will go right if you have hard-links and circular references...

Edited for typos and missing infos :oops:
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

2Samuel,
Does the 500 and 540 do all drives then or do I need to do it for each drive?

2nsp,
I have XCD but bever really played with it. I just tried it and it only updates the treeinfo file on the C drive. D drive doesn't get touched. I have C and D drive as partitions on a single drive. How do I make it do the D drive, too?
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

Samuel wrote:So this should work: (no popup)

Code: Select all

[Button 2 Normal]
1_File=cmd.exe
1_Parameter=/c del C:\treeinfo.wc
2_File=cmd.exe
2_Parameter=/c del D:\treeinfo.wc
3_File=cmd.exe
3_Parameter=/c del E:\treeinfo.wc
...
4_Command=500
5_Command=540
You need the 2 lines for every drive.
The command window pops up and closes but files do not get deleted. I tried it without the last 2 lines first. I'm wondering if we have to change to the directory first. And I'm not sure how to keep the command window from popping up and closing. EditPlus stops the window from doing that but I'm not sure how he did it.
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

Couldnt you try this for yourself? (Its for only one drive)

Commands 2063 (cm_GotoDriveC) and 2064 (cm_GotoDriveD) could help you:

Code: Select all

[Button 2 Normal]
1_File=cmd.exe
1_Parameter=/c del C:\treeinfo.wc
2_File=cmd.exe
2_Parameter=/c del D:\treeinfo.wc
3_Command=2063
4_Command=500
5_Command=540
6_Command=2064
7_Command=500
8_Command=540
untested.

2nsp:
Thougth about cmd file, but it would be 2 files then.
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

Tested only with non hidden files:
change: del file
to: del /ah file

Perhaps like this:

Code: Select all

[Button 2 Normal]
1_File=cmd.exe
1_Parameter=/c del /ah C:\treeinfo.wc
2_Command=2063
3_Command=500
4_Command=540

[Button 2 Ctrl]
1_File=cmd.exe
1_Parameter=/c del /ah D:\treeinfo.wc
2_Command=2064
3_Command=500
4_Command=540
Doesnt always work. Perhaps my AHK Script needs some delay Command.
As a workaround you could separate it like:

Code: Select all

[Button 2 Normal]
1_File=cmd.exe
1_Parameter=/c del /ah C:\treeinfo.wc

[Button 2 Ctrl]
1_Command=2063
2_Command=500
3_Command=540

[Button 3 Normal]
1_File=cmd.exe
1_Parameter=/c del /ah D:\treeinfo.wc

[Button 3 Ctrl]
1_Command=2064
2_Command=500
3_Command=540
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

2Samuel.
I never got past the part of the files not getting deleted. The reason is that they are hidden files.

I would have played with the other part of it and figured it out if I could get past the first part.

EDIT: I was typing as you were typing. I will see what I can do with what you posted then.
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

Ok, I got it. I went with XCD doing it for now, until we can, hopefully, get some delay commands built into toolbar, if possible.

Thank guys for all of your help.
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
eugensyl
Power Member
Power Member
Posts: 564
Joined: 2004-06-03, 18:27 UTC
Location: România
Contact:

Post by *eugensyl »

Samuel, have you plan to add support for environmental variable in toolbar.ini file? Also, support for load a button bar?

Actually, I want to use relative path from TC installed directory.
My Best Wishes,

Eugen
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

A delay command would be nice, also.
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
Post Reply