Featured Resource:

line

Newsletter

Email Address:


line

Ask the Expert

Have a question for our resident expert? Email your questions to Bob or post in the Forum.

« New Application Compatibility Forum | Main | Keyboard Shortcuts for Window Management »

Command Prompt Here?

When you are working with scripts and command line tools, it not uncommon that you want a command prompt in the folder where these scripts and command line tools are stored. The easy thing to do would be to create a shortcut to the command prompt that opens at that location:

1) right click on the desktop (or in the folder where you want your shortcut and select "New" > "Shortcut".
2) for location of the item, simply enter "cmd.exe" (you don't need to specify the path because it is located in the system path) and press the "Next" button
3) next, give the shortcut a friendly name, like "My Scripts" and press the enter key
4) now right click on your new shortcut and choose "Properties"
5) the default tab shown should be the "Shortcut" tab. On this tab enter the desired folder path in the field marked "Start in" and you are done.

But suppose you don't keep all your scripts or command line tools in one place. In that case a more dynamic way of getting there is in order and here's the trick: add "Command Prompt Here" to your file explorer context menu. Here's how:

Launch a command prompt with elevated privileges and enter the following command:

reg add "HKLM\software\classes\folder\shell\Command Prompt Here\Command" /ve /d "cmd.exe /k pushd %L" /t REG_SZ

That does it...

cmd-here.jpg

Library Resources

line
line

Bob Kelly's Bio:

Bob Kelly is the founder of AppDeploy.com — a resource focused on desktop management products and practices. He is author of the Start to Finish Guide to Scripting with KiXtart and The Definitive Guide to Windows Desktop Administration. He is also president and co-founder of iTripoli, Inc. who provide AdminScriptEditor.com, home to an integrated suite of scripting tools and a shared library of scripts and language help. Not enough? For more on Bob click here.