fortypoundhead.com

How to Open an Elevated Command Prompt

Posted On 2014-02-12 by dwirch
Keywords:
Tags: Tutorial Tip Security Windows Windows 7 Windows 8
Views: 715


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.

 


About the Author

dwirch has posted a total of 173 articles.

You can find more information from dwirch by visiting http://www.derekwirch.com.


Comments On This Post

No comments on this post yet!


Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.


Your IP address is:54.198.233.27

Before you can post, you need to prove you are human. If you log in, this test goes away.



Recent Forum Posts

Fold Code Manager into main KB?
VB6Boy posted on July 22, 2017 at about 14:42 in Site News

Fold Code Manager into main KB?
dwirch posted on July 22, 2017 at about 14:41 in Site News

Fold Code Manager into main KB?
dwirch posted on July 21, 2017 at about 22:46 in Site News

Fold Code Manager into main KB?
dwirch posted on July 20, 2017 at about 7:55 in Site News

Job Spammer: Sam Mallon
dwirch posted on July 18, 2017 at about 18:36 in Spammers

When setting up a certificate authority ...
dwirch posted on July 13, 2017 at about 9:07 in General