Please Help With Command Prompt Button

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
Jaguarist
Junior Member
Junior Member
Posts: 68
Joined: 2003-08-24, 10:59 UTC
Location: Central USA

Please Help With Command Prompt Button

Post by *Jaguarist »

Hello all. I do believe I'm starting to get the hang of this superb program. I am, however, stuck on a minor issue with creating a custom button to launch the system command prompt within Windows XP.

I have created the button, and pointed it to C:\Windows\System32\cmd.exe

This starts the Command Prompt quite well, with one exception, and that is what I would like some help with, if anyone has the knowledge.

Currently when I start the Command Prompt, it has the Start Path of C:\Windows\System32 .

What I desire is to have the Command Prompt start with the Start Path of the current lister window under focus. In other words, if I am in a lister window of say D:\Games then I would like the Command Prompt to have that start path. Or, if I am in E:\Docs then I would like the Command Prompt to start in that directory.

Is there a way to write this in the Start Path text line of the button customization dialog box?

Thank you very much!! :-)
Namaste

Jag
User avatar
Leif
Senior Member
Senior Member
Posts: 328
Joined: 2003-02-05, 15:44 UTC
Location: Umeå, Sweden

Post by *Leif »

Parameter: %p
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

You can use: cm_ExecuteDOS instead of C:\Windows\System32\cmd.exe and it starts in the current directory.
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

2Jaguarist

Hi, there is an inbuilt TC Command :arrow: 'cm_ExecuteDOS', what works exactly as you would like. Replace your 'C:\Windows\System32\cmd.exe' with this command and when you click this button the DOS Window will open in your current directory.


sheepdog
User avatar
Jaguarist
Junior Member
Junior Member
Posts: 68
Joined: 2003-08-24, 10:59 UTC
Location: Central USA

Post by *Jaguarist »

Excellent, thank you VERY much!!
Namaste

Jag
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Fast!

Post by *Clo »

Leif wrote:Parameter: %p
:D Hi Leif!
:P Always fast!
¤ In elegant French: toujours prompt ... :lol: That does a fine joke! :lol:
8) Now begins the "Insomniacs Club" !
:) Kind regards, cordialement,
Claude
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
Jaguarist
Junior Member
Junior Member
Posts: 68
Joined: 2003-08-24, 10:59 UTC
Location: Central USA

Post by *Jaguarist »

Well, that worked so well, that I'd like to see if I can push the envelope here.

Is there a way to have the selected(read-highlighted) batch file name also be input to the command line of the Command Prompt program?

As it is now, with all your help, it points to the correct current directory, and it would be a dream if it could also have typed in the name of the batch file, for example D:\Games\Sample\example.bat


Would that be possible, and if so, how would I write that one up in the button dialog box?

Many thanks, once more for your patience and guideance!!
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

Try to use %N as parameter (read the manual about parameters for buttons)
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Possible...

Post by *Clo »

2Jaguarist
for example D:\Games\Sample\example.bat
:D Hi!
* Open the dir >> sub-dir in a pannel, then carry the *.bat file on the command line via Drag & Drop
* Press ENTER or Shift+ENTER (keeps the Dos-box open)
That's all!
:) Kind regards,
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

2Clo

Thats a really cool use for 'drag & drop'.:wink:

sheepdog
User avatar
Jaguarist
Junior Member
Junior Member
Posts: 68
Joined: 2003-08-24, 10:59 UTC
Location: Central USA

Post by *Jaguarist »

Thanks guys, but no dice, not yet anyway. The drag n drop, then pressing Return just opened the .bat file in my text editor.

I also tried the %N parameter, but it did the same that the %p did. Both those parameters have the command prompt open in the current directory under focus, but will not include the highlighted file name.

No biggie, I can type it from there, but I was just wondering how far I could go with this button. :-)

I will also take the suggestion to read about the parameters in the manual.

Thanks again, and have a great weekend, all !!
User avatar
Jaguarist
Junior Member
Junior Member
Posts: 68
Joined: 2003-08-24, 10:59 UTC
Location: Central USA

Post by *Jaguarist »

Well, if I would do a COMPLETE read of the instructions, I would be better off.

The Shift+Enter did the trick! :-)

Most Excellent, and I commend the knowleged here on this board. :-)
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Mouse-lover

Post by *Clo »

Sheepdog wrote:2Clo

That's a really cool use for 'drag & drop'.:wink:

sheepdog
:D Hi!
¤ I discovered this because the keyboard-shortcut Ctrl+J or Ctrl+ENTER were missing in the Help!
:( I'm forced to be a "Mouse-Lover", because I've a problem at my right hand, not a disaster, but painful and annoying...
Thanks,
:) kind regards,
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

When I've used something like this:

Command: C:\windows\system32\cmd /k
Parameters: %N

It just run the highlighted batch file.
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
Jaguarist
Junior Member
Junior Member
Posts: 68
Joined: 2003-08-24, 10:59 UTC
Location: Central USA

Post by *Jaguarist »

djk wrote:When I've used something like this:

Command: C:\windows\system32\cmd /k
Parameters: %N

It just run the highlighted batch file.

That's the WINNER!! With that setup, I don't even have to press the Enter key when the Command Prompt program comes up.

Now, I'm off to read my manual more closely.
Namaste

Jag
Post Reply