How to Create an Elevated Command Prompt Shortcut in Windows 10 and Windows 11

An image of a ladder

This step-by-step tutorial shows you how to create an elevated Command Prompt shortcut with administrative privileges in Windows 10 and Windows 11. It explains how to create a shortcut, make sure it will run as administrator, and how to pin it to the Start menu or taskbar and give it a unique icon.

Understanding the Elevated Command Prompt in Windows 10 and Windows 11

An ‘elevated’ Command Prompt in Windows means it is running with administrative privileges. By default (and even while logged in with an administrator account), Command Prompt does not open with administrative privileges on Windows 10 and Windows 11.

An elevated Command Prompt is required to perform tasks that affect the system. This includes maintenance and repair tasks like verifying system files using the System File Checker, checking disks using Check Disk as well as managing networking, users, and other administrative functions.

Benefits of creating a shortcut for an elevated Command Prompt

If you’re in a hurry, and you’re just looking for a quick and easy way to run a Command Prompt command as administrator, right-click the Start button and click Windows PowerShell (Admin) on Windows 10, and Terminal (Admin) on Windows 11. 

PowerShell is replacing the Command Prompt in Windows 10 and 11 and will happily run almost any Command Prompt command (PowerShell is also a much more powerful and modern tool, so you should switch to it for general use and creating scripts in future).

The biggest caveat of the move to PowerShell as the default terminal in Windows is old Command Prompt scripts. While running commands should mostly work, some older scripts that use environment variables or piping may not behave correctly. If you regularly deal with old scripts that don’t need to be re-written just to make them work with PowerShell, creating a shortcut to an elevated Command Prompt is a time-saver for system administrators.

How to create an elevated Command Prompt shortcut in Windows 10 and Windows 11

To create an elevated Command Prompt shortcut in Windows 10, follow these steps:

  • Right-click on the Desktop
  • If you are using Windows 11, select Show more options (Windows 10 users can skip this step)
  • Select New > Shortcut
  • In the Type the location of the item: field, enter %ComSpec% /k

Create shortcut window

  • In the Type a name for this shortcut: field, enter Elevated Command Prompt
  • Click Finish to create the shortcut
  • Right-click on the new Elevated Command Prompt shortcut on your desktop
  • Select Properties

Elevated Command Prompt 

  • In the Shortcut tab, click on Advanced… and check the Run as administrator checkbox

Advanced Properties

  • Click OK, and then Apply to confirm the change
  • Close the Properties dialog
  • You can now run Command Prompt as administrator by opening the new desktop shortcut — note that you’ll receive a User Account Control prompt to confirm that you want to allow the Command Prompt to make administrative changes to your system

User Account Control
In Windows, the %ComSpec% environment variable always points to the full path to the Windows Command Prompt executable (cmd.exe). The /k parameter ensures that the cmd.exe window stays open once it has opened, as the default behavior is to close immediately once execution has completed.

If you want to change the icon for the elevated Command Prompt shortcut, re-open the properties, and navigate back to the Shortcut tab, and then:

  • Click Change Icon
  • Select a new icon from the Windows defaults, or browse to your own icon file
    Change Icon
  • Click OK
  • Click Apply to confirm the change and then close the Properties dialog

Troubleshooting elevated Command Prompt shortcut in Windows

If you receive access denied errors while trying to open the Windows Command Prompt as an administrator, first check that you are logged in to a user account that has administrative privileges. A quick way to check whether your account is an administrator is to right-click on the Start button and see if the option to run PowerShell or Terminal as administrator is there — if it isn’t, you may not have administrative privileges.

It is also possible that User Account Control (UAC) is silently preventing Command Prompt from opening as administrator. You can check this by following these steps to open the Control Panel and view UAC settings:

  • Right-click on the Start button and select Run
  • Enter control in the Open: field and then click OK
  • Open User Accounts from the Control Panel
  • Select Change User Account Control Settings

If UAC is set to Never notify, it’s possible that your shortcut is set up properly but that it’s not displaying the UAC prompt to actually open the Command Prompt. Change the UAC setting to notify you when an app tries to make changes to your computer and test your elevated Command Prompt shortcut again.

Best practices for using an elevated Command Prompt

Only use an elevated Command Prompt for administrative tasks. For general usage, stick to a regular non-administrative terminal so that you can’t accidentally make any changes to your system.

It’s also important to never run commands or scripts from the Internet without first understanding what they will do. Look up the programs and parameters for each command and check what the outcome of running them will be. Unfortunately, hackers are known to post malicious code and scripts online in the hope that someone will run them without first checking them, compromising security and installing malware or giving the hacker access.

Deploying administrative Command Prompt and PowerShell Scripts

Endpoint Management by NinjaOne can deploy administrative Command Prompt and PowerShell scripts to a fleet of devices in an enterprise environment, including remote devices for remote workers and office environments on a Windows domain. By centralizing and automating your administrative tasks, you can ensure that every device is fully configured, up-to-date, and secured — and that users don’t feel the need to try to perform administrative tasks themselves.

Next Steps

Building an efficient and effective IT team requires a centralized solution that acts as your core service deliver tool. NinjaOne enables IT teams to monitor, manage, secure, and support all their devices, wherever they are, without the need for complex on-premises infrastructure.

Learn more about Ninja Endpoint Management, check out a live tour, or start your free trial of the NinjaOne platform.

You might also like

Ready to simplify the hardest parts of IT?
×

See NinjaOne in action!

By submitting this form, I accept NinjaOne's privacy policy.

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).