Since I’m often using Windows Command Prompt(CMD), I also often need to run it as an administrator. This is mostly due to permission issues some applications I run may have. That’s fairly simple thing to do.
- Type CMD in Windows 10 Cortana(search box in the taskbar)
- Type cmd
- Right click on the Command Prompt(in results)
- Click Run As Adminstrator.
This is fairly easy solution, but since I’m using it often, I needed a way to pin this to the Windows taskbar, and make sure it’s run as Administrator. Also, by default, when running CMD with administrator privileges, default directory path is C:\Windows\System32\, which I also wanted to change to my Projects folder. In order to do this, I needed to hack your way through Windows 10, to make sure I don’t spend much time for such trivial tasks.
Create shortcut to CMD(Command Prompt)
Close or minimize all your open apps and directories, to begin with. Right click on empty space on desktop to get a context menu, then navigate to New->Shortcut. Now, you’ll be asked where is the app you want to create shortcut to located. In case you’re on a default non-modified Windows 10 installation, Command Prompt(CMD)’s default location is at C:\Windows\System32\cmd.exe, so you may want to use that as well, and then click Next. In the screen to follow, name your shortcut, in my case CMD Administrator, then click Finish.
Run Command Prompt(CMD) shortcut as administrator
Now, to make sure you always run your newly created shortcut with administrator privileges, right click on it to bring context menu to front, then click Properties. In the Shortcut Properties dialog, click the Advanced button, check Run as Administrator checkbox, and then click OK.
Change default directory path for Command Prompt(CMD) shortcut
While still on the Shortcut Properties dialog, you’ll see a Start In field, which is set to already mentioned C:\Windows\System32\. Now, simply change this value to anything you prefer – I set C:\Users\milos\Projects as default location for my newly created shortcut.
Pin Command Prompt(CMD) shortcut to taskbar
With all this being done, simply right click the shortcut you’ve just created on your desktop, and click Pin to Start, to make sure it’s always easily accessible.