I used Windows Explorer all the time to navigate my hard drive. Many times throughout the day I need to drop to MS-DOS within a specific directory. I'm too lazy to drop to DOS and navigate using the command line so I created a registry entry that will launch a CMD window from Windows Explorer and place me in the selected directory. You can run the following VBScript to do the same for yourself.

Set WshShell = CreateObject( "WScript.Shell" )
WshShell.RegWrite _
"HKEY_CLASSES_ROOT\Folder\Shell\Command Window\Command\", _
"CMD /K cd /d %L"

As an added bonus, you can run the VBScript below to create a menu item that will launch a CMD window that has been setup for the Microsoft Visual Studio .NET tools.

vsnetPath = _
"d:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\vsvars32.bat"
Set WshShell = CreateObject( "WScript.Shell" )
WshShell.RegWrite _
"HKEY_CLASSES_ROOT\Folder\Shell\Open VS.NET Command Window Here\Command\", _
"CMD /K """ + vsnetPath + """ : cd /d %L"

Be sure to modify the path above to match your installation of Visual Studio.NET.

To use launch an instance of Windows Explorer and navigate to the desired directory. Right mouse click the directory name and select Open Command Window Here or Open VS.NET Command Window Here menu item. Now ain't that nice?

posted by Kirby Turner | 27-Aug-2002 5:01 PM | comments (0)

Add Your Comment

Comment:
(No HTML)

Name:
E-mail/Web site:
Your e-mail/web site will not be published on this site. It is optional and will only be used by me should I need to contact you directly.
 
By checking this option, this site will remember your name and e-mail/web site on future visits. Uncheck this option to have the site not remember who you are on future visits.
 
Enter the code shown above:
Copyright © 1999-2008 Kirby Turner.
Site software written by White Peak Software Inc, a provider of custom software and software development coaching.