While using the command shell or command prompt on Windows Vista and Windows 7, you must have seen messages like,
Access denied, or The requested operation requires elevated privileges.
These messages are shown when you try to access system files using a normal command prompt, that is, a command prompt with low privileges.
By default, all the processes in Windows are run in low privilege mode. The new security mechanism in Windows, called User Access Control (UAC) keeps an eye on each processes and the files, folders and registry keys it is accessing.
If a process tries to access these files without possessing the privileges to access it, the access is denied and the process is terminated.
So when you use any command that accesses a system file or registry from a command prompt with low access rights, you get error messages like above. The solution to this issue is to run the command prompt with administrator privileges. Following are some of the ways to open command prompt as administrator.
• Click on Start button, then Go to All Programs > Accessories, and find Command Prompt. Right click on the Command Prompt menu item and click on Run as Administrator.
• Open run box from start menu, or by pressing Windows Key+R. In the run box, type cmd, but instead of pressing Enter, press Ctrl+Shift+Enter. Then press OK on the User Account Control dialog.
This trick is also useful in running any single command with administrative privileges. Just type the command in the run box, and press Ctrl+Shift+Enter instead of Enter. The command will run with escalated privileges.
So, if you just want to run a single command with higher access rights then you can directly use this trick instead of starting a command prompt first.
• You can easily run command prompt as administrator using any of the above method. But if you need to run administrative commands frequently, then here’s an easy way out. Create a command prompt shortcut that always runs as administrator. To do this,
1. Create a shortcut for Command Prompt on desktop, or any other place you like.
2. Right click on this newly created shortcut and click on Properties.
3. Activate the Shortcut Tab, and click on Advanced button.
4. Now select the check box that says Run as administrator.
5. Click OK two times to save these settings.
Now just double click on this shortcut to launch a command prompt as administrator.