As a developer, I often have the need to open a command prompt for various purposes. For example, I use
iisreset to restart my local web server.
I typically open the command window in one of two ways:
- Press Win, type "cmd" and press Enter
- While in Explorer, hold Shift and right click on a folder, and choose "Open command window here"
However, when I open the command window in either of these ways, I do not have the full administrator privileges that I feel I am entitled to.
In order to run administrator-only applications, I have to open the command line in this relatively laborious way:
- Press Win, type "cmd"
- Wait for the menu to populate
- Lift hand off the keyboard and put it on the mouse
- Right click the "cmd.exe" menu item
- Choose "Run as administrator"
This is unacceptable for several reasons:
- The window always opens in C:\windows\system32, rather than my
Usersdirectory (as in approved technique 1) or the folder I want to be in (as in approved technique 2). So I often have to change directories to get where I want to go.
- This process is several milliseconds slower than either of my preferred methods. Performed several times a day, every day for the remainder of my career, it adds up to about ten days of lost time spent clicking and waiting and directory changing.
- As a programmer, performing a pointless robotic task causes me great emotional pain.
- As a programmer, lifting my hand is a strenuous task that causes me great physical pain.
That is why I am looking for a one-and-done solution that will let approved techniques 1 & 2 open administrator command prompts.
Many programs let you permanently change their default privilege level from the Properties menu. Command Prompt is not one of those programs.
How do I make the command window run as administrator by default (even when using the "Open command window here" context menu option)?