How to add the Button Bar icon for two command?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
waifile
Junior Member
Junior Member
Posts: 10
Joined: 2016-11-11, 08:29 UTC

How to add the Button Bar icon for two command?

Post by *waifile »

How to add the Button Bar icon for two command?
I want go D:\, and open C:\1.txt

I try command m_GotoDriveD,C:\1.txt but not working.

Thank you.
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

How to add Button Bar command with two command?

Post by *Stefan2 »

Hi and welcome.

See TOTALCMD.INC for available commands.


For other need commands, create your own via usercmd.ini

Like
usercmd.ini
[EM_openTextfile]
cmd=Notepad "C:\1.txt"

Then use as button command: cm_GotoDriveD,EM_openTextfile



Search the forum for more examples (or read there e.g.: http://ghisler.ch/board/viewtopic.php?p=287794#287794)




 
waifile
Junior Member
Junior Member
Posts: 10
Joined: 2016-11-11, 08:29 UTC

Re: How to add Button Bar command with two command?

Post by *waifile »

Thank you.
waifile
Junior Member
Junior Member
Posts: 10
Joined: 2016-11-11, 08:29 UTC

Re: How to add Button Bar command with two command?

Post by *waifile »

Stefan2 wrote:Hi and welcome.
See TOTALCMD.INC for available commands.

For other need commands, create your own via usercmd.ini

Like
usercmd.ini
[EM_openTextfile]
cmd=Notepad "C:\1.txt"

Then use as button command: cm_GotoDriveD,EM_openTextfile

 
Anyway can daley 2sec for next command?
EM_openTextfile,cm_GotoDriveD

For exsample, open C:\1.txt frst, daley 2sec then GotoDriveD.

Thank you.
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

I think there is no pause command.

And you can't utilize external tool, since TC don't wait for the finishing of that tool.

Try that with another usercmd calling a DOS command:

[em_Wait2s]
cmd=CMD/C Timeout /t 2
iconic=1

>> [face=comicsansms]For exsample, open C:\1.txt frst, daley 2sec then GotoDriveD.[/face]

EM_openTextfile,em_wait2s,cm_GotoDriveD


That will not work as expected.


---

But you can use a external script to open that text file and perform the pause,
next you can send TC a message to execute an internal command.

Best tool would be AutoHotkey.
But DOS-Batch and nircmdc.exe from NirSoft would work also.




 
waifile
Junior Member
Junior Member
Posts: 10
Joined: 2016-11-11, 08:29 UTC

Post by *waifile »

Thank you.
User avatar
petermad
Power Member
Power Member
Posts: 16134
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2Stefan2

In TC9 yo can use cm_wait 2000 in stead of em_wait2s
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
petermad
Power Member
Power Member
Posts: 16134
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2waifile

This button should do what you want:

Code: Select all

TOTALCMD#BAR#DATA
cm_GotoDriveD,cm_list c:\1.txt

%COMMANDER_EXE%,6



-1
copy the code above to clipboard, right-click on your button bar and chose "Paste"
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

petermad wrote:2Stefan2

In TC9 yo can use cm_wait 2000 in stead of em_wait2s
Thanks for the reminder, that works with TC9-RC ( Total Commander 9.0 release candidate 5 available )


c:\1.txt,cm_wait 2000,cm_GotoDriveD




That is automatically changed by TC to
cm_list c:\1.txt,cm_wait 2000,cm_GotoDriveD


 
Post Reply