Add a right-click command-line prompt

If a user types CMD in Windows 2000 to open a CLI (command-line prompt), the CLI opens in the Documents and Settings subfolder for the currently logged-in user. This usually isn't the most convenient place to start a CLI, however. Many people need to open a CLI in an arbitrary folder, and would like to be able to do so without having to type a CD command to change into the folder. With long pathnames, this can be cumbersome and time-consuming.

Windows 2000 has a hidden way to allow an administrator to enable a right-click context menu option to launch a CLI from a particular folder. It can be created on a system after installation, or made part of a system image and rolled out as a standard feature.

To add a right-click CLI context menu option to a system, open the Registry and create a subkey named DosHere in \HKEY_CLASSES_ROOT\Directory\Shell. Rename the existing (Default) REG_SZ value to Dos &Prompt Here (note the & sign). Inside this key, create a subkey called Command and edit its (Default) value. Leave the name of the value as "(Default)" but set the value to:

%SystemRoot%\System32\cmd.exe /k cd "%1".

(Be sure to substitute the name of your system root (e.g. C:) for the %SystemRoot% parameter in the above statement.)

Do the same as above in \HKEY_CLASSES_ROOT\Drive\Shell. This will allow you to do the same thing for a drive icon as well as a folder; the two Registry edits operate entirely

Requires Free Membership to View

independently of each other.

Serdar Yegulalp is the editor of the Windows 2000 Power Users Newsletter. Check out his Windows 2000 blog for his latest advice and musings on the world of Windows network administrators – please share your thoughts as well!

This was first published in September 2003

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.