How to Open an Elevated Command Prompt

By | 2014-02-12

There is something of a mantra in the IT world: If it has to be repeated more than once, script it and automate it.  The same goes for Q&A.  If more than one person asks about it, write it down. So here you go.

Why do you need to open an elevated command prompt?  With newer Windows operating systems, certain files and functions are protected.  Even if your user account is in the local administrators group, you still won’t be able to perform certain things on your computer.

For example, you may be testing network or internet enabled application, but you want the queries to go to specific server, like a dev/test copy of a database.  One simple way of doing this is modifying your hosts file at C:\Windows\System32\drivers\etc.  So you think, “No problemo!”

Not so fast, sparky.  If you simply open the file in notepad, or use my preferred method of opening a command prompt, you’ll get either an access denied/save-as dialog (notepad method), or you’ll get a The requested operation requires elevation at which point you’ll be dumped back to the command prompt.

The good news is that it’s really easy to open an elevated command prompt, and the process is the same in Windows 7 and Windows 8.

  1. Tap the Windows key on your keyboard to bring up the Start menu or Start screen.
  2. Type CMD, and the command prompt shortcut will bubble to the top.
  3. Right-click the shortcut, and select Run As Administrator from the context menu. 
  4. If you have UAC turned on, you’ll get a dialog asking if you are sure. Select the affirmative, and your elevated command prompt will be displayed.

If you want to bypass this process, you can turn off User Account Control (UAC) completely.  I wouldn’t recommend it, though; it’s there for a reason.

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.