Daniel Petri is a world-known IT professional, technical trainer and creator of one of the world’s largest IT knowledge bases – www.petri.com. Daniel consults to leading global Fortune 1000 companies in Microsoft IT Infrastructure and Engineering strategies.

For his contribution to the IT Pro community Daniel has received the Microsoft Most Valuable Professional (MVP) award for the 14th time. Daniel’s professional certifications include Microsoft Certified Technology Specialist, Microsoft Certified Systems Engineer, Microsoft Certified System Administrator and Microsoft Certified Trainer.

While working for Microsoft, Daniel serves as a Senior Premier Field Engineer (PFE) specializing in Windows Server OS and Active Directory.
Daniel now works for ObserveIT, makers of the Insider Threat Detection software, where he holds the role of Senior Solutions Architect, where he manages large deployment projects and partner and customer training programs.

In his spare time, Daniel rides a 1200cc 2015 model Ducati Multistrada 1200S bike and manages the Israeli Bikers forum.

You can contact Daniel at daniel-at-petri-dot-co-dot-il.

How can I quickly open Command Prompt (cmd) with elevated credentials in Windows Vista?

How can I quickly open Command Prompt (cmd) with elevated credentials in Windows Vista?

As you’ve learned so far, Windows Vista has the built-in ability to automatically reduce the potential of security breeches in the system. It does that by automatically lower the administrative rights of users that are part of the local administrators group, and forces them to run applications and commands like they were regular users with no administrative privileges.

For example, if you ran CMD as a user that was a part of the Local Administrator’s group, or even as the Administrator himself, you’d get a nice Command Prompt window:

Now try to run any command that requires administrative rights, for instance use the following command as a test:

Lamer note: This command will change the administrator’s password to "[email protected]!", don’t run it, it’s just an example. And if you do run it, change the password to whatever string you want. Don’t come crying that you can’t logon to the computer anymore after changing the password!

Note that the command refuses to run because of permission issues.

So how do we perform administrative tasks in Windows Vista?

In order to gain your administrative rights you need to use the RUNAS command from the command prompt, or from the Graphical User Interface (GUI) by right-clicking the required application and selecting the "Run as administrator" option:

After selecting that option you need to pass the UAC prompt by pressing "Continue" (unless you’ve already disabled it. Read What’s User Account Control in Windows Vista? and Disable User Account Control in Windows Vista for more info)

Instead of using the RUNAS command from the command prompt or the GUI "Run as administrator" option you can perform the following trick:

Note: This tip seems to only work with .EXE files, and does not work for shortcuts.

  1. Click on the Vista logo (used to be the "Start" button.

  2. In the "Start Search" box type the name of the program you want to run as administrator. For example type CMD or CMD.EXE.

  1. Do NOT hit ENTER. Instead hit CTRL+SHIFT+ENTER. It seems that this key combo triggers user account elevation and is identical to the RUNAS command or the GUI "Run as administrator" option.

  2. You will be prompted by the UAC warning window. Click on CTRL+C or click on the "Continue" button.

  1. Note that the CMD window has an "Administrator:" appended to the window title.

  1. You can now perform any administrative tasks you want.

Related articles

You might also want to read the following related articles:

Related Topics:

  • Windows Vista
  • BECOME A PETRI MEMBER:

    Don't have a login but want to join the conversation? Sign up for a Petri Account

    Register