Vista Command Prompt

Last Update: Sep 24, 2024 | Published: Jan 07, 2009

SHARE ARTICLE

The Command Prompt is a native Windows program that lets you execute commands without using a GUI. You can accomplish pretty much every task in the Command Prompt as you can with the GUI and a mouse. The Command Prompt gets its roots (arguably) from a combination of UNIX and MS-DOS. Consider it “Windows without the windows.”

Microsoft has streamlined your ability to launch Command Prompt sessions in Windows Vista. Besides accessing the Command Prompt through the Start Menu, the following are three other methods to launch the Command Prompt with varying permission-levels.

Shift and Right-Click

You can hold down shift and right-click and you will get the option to “Open Command Window Here.” This will open a Command Prompt that is queued to your current directory.

this image has been lost in time

For example, if I use the above command on the desktop, the corresponding Command Prompt session will be set to C:UsersasdfDesktop”:

this image has been lost in time

Creating an Administrator Session Shortcut

Alternatively, you can create a shortcut to give yourself an elevated (administrator) Command Prompt session by right-clicking on the desktop and creating a shortcut:

vista command prompt 03 small

For the location of the item type “cmd” and click Next:

this image has been lost in time

Name the shortcut “cmd” and click Finish:

this image has been lost in time

Your shortcut will now be created. Right-click on the shortcut and choose “Properties”:

this image has been lost in time

In the properties dialog, select the “Shortcut” tab, and click Advanced…

this image has been lost in time

In the Advanced Properties, check “Run as administrator,” and click Ok:

this image has been lost in time

Anytime you launch the shortcut, you will have administrator privileges, and your Command Prompt session will start in “C:Windowssystem32” instead of the normal “C:Users“:

this image has been lost in time

Right-click for administrator privileges

Additionally, you can edit the registry to add a right-click option for "Administrator Command Prompt Here." This is useful if you are buried in a directory and want to launch an administrator session on the fly.

vista command prompt 13 small

Note: Editing the registry has the potential to cause serious (and unrecoverable) damage to your PC. If you are at all uncomfortable editing the registry, please do not attempt the following.

Copy the following text into a Notepad file and save the file as AdminPrompt.reg:

 Windows Registry Editor Version 5.00
 


[HKEY_CLASSES_ROOTDirectoryshellrunas] @="Administrator Command Prompt here" "NoWorkingDirectory"="" [HKEY_CLASSES_ROOTDirectoryshellrunascommand] @="cmd.exe /k "pushd %L && title Command Prompt"" [HKEY_CLASSES_ROOTDriveshellrunas] @="Administrator Command Prompt here" "NoWorkingDirectory"="" [HKEY_CLASSES_ROOTDriveshellrunascommand] @="cmd.exe /k "pushd %L && title Command Prompt""

Open your registry by clicking the Start Menu and typing “regedit.” Windows will prompt you for confirmation before running the Registry Editor. In the File menu click Import

this image has been lost in time

Navigate to your AdminPrompt.reg file and click Open:

this image has been lost in time

You will get the following message that says “The keys and values contained in AdminPrompt.reg have been successfully added to the registry.” Click Ok:

this image has been lost in time

Whenever you right-click a directory, you will now have the option of launching an Administrator Command Prompt Session queued for that current directory:

vista command prompt 13 small

Summary

Here is what you’ve learned to do:

  • Shift + right-click and open a user-privileged Command Prompt session
  • Right-click and open an administrator-privileged Command Prompt session
  • Create an administrator-privileged Command Prompt shortcut
  • Import a registry file

Related Links

SHARE ARTICLE