February 04, 2003

Command prompt here    [ Software ]

This is a tip I saw years ago, but I've never written it down.   So after about three minutes of googling, I found the Microsoft TechNet article on how to set up a "Command prompt here" option when you right-click on a folder.

Basically, you write a bit of code to interface with Windows Scripting Host:

Set objShell = CreateObject("WScript.Shell") objShell.RegWrite "HKCR\Folder\Shell\MenuText\Command\", "cmd.exe /k cd " & chr(34) & "%1" & chr(34) objShell.RegWrite "HKCR\Folder\Shell\MenuText\", "Command Prompt Here"

Save it as a .VBS file and run it, and it'll add the registry entries to invoke a command prompt in the right-click menu for directories.   Comes in handy for running CLI tools against specific files, like checking MD5 sums on ISOs that you've downloaded.   This should work on NT4, Win2K, WinXP and .NET server without a problem.

Posted by edobbs at February 4, 2003 09:04 AM