Open Command Window (cmd) / Program as an Administrator in Windows 7


Consider you have a situation where, you need to work with applications which needs administrator privileges. Just invoking the application shortcut / command window will not help in Windows 7, as you will be running in as a Standard User. (Read User Account Control to understand more in detail). You will need to launch the program in an elevated context to run it as an administrator. A simple right-click on the program/shortcut and choose ‘Run As Administrator’.

However, you cannot follow this method all-time. Especially, when you need to this more frequent. Here is a simple technique (using Application Shortcuts) which will help you in elevating programs.

If you want to implement this alongside the executable itself, you will need to create a RunasAdmin or RunAsInvoker Shim for this purpose. – Read this Article for more information.

Step 1: Create a Shortcut for the application. You can either use Pinning feature, where you can pin an application to the start-menu or the task-bar. You can also create it on the desktop.  In this example, Let’s choose a Command Window (cmd). (You can use this technique for any application)

Step 2: Right Click and goto the properties of the Command Prompt, Select the ‘Shortcut’ tab.

Step 3: Goto Advanced Tab, And select the ‘Run As Administrator’ checkbox in the Advanced Properties.

This will ensure that, this shortcut will run the program in elevated context all the time. You can always invoke the other default shortcut from the start menu, to launch the application in the standard User mode (if you really need to).