Run as admin from cmd windows

How to Run Command Prompt as Admin

This basic guide details 8 ways how to run a command prompt as an administrator on Windows.

Contents

💡 On Windows 10, 8.1, 8 – instead of the command prompt, you can use PowerShell, which supports all cmd.exe commands.

Via List of programs

Run the command prompt as admin from the list of standard Windows programs.

💡 Suitable: Windows 10, Windows 8.

  1. Open the Start menu (Ctrl + ESC);
  2. Open the Windows System;
  3. Right-click Command PromptMoreRun as administrator.

Run the Command prompt as administrator from the Start menu

We enable the ability to run the command prompt as administrator on the menu on the Start button.

💡 Suitable: Windows 10, Windows 8.

  1. Right-click on the Taskbar, select – Taskbar settings;
  2. Disable the Replace Command Prompt with Windows PowerShell in the menu…;
  3. Right-click on the Start button (Windows + X), select Command Prompt (Admin).

Run the Command prompt as administrator via Quick links

Via Task Manager (quick)

Running a Command Prompt as administrator via the Windows Task Manager (quick way).

💡 Suitable: Windows 10, Windows 8, Windows 7.

  1. Call Task Manager (Ctrl+Shift+ESC);
  2. Click on the File;
  3. Hold down the Ctrl key and click Run New Task.

Run the Command prompt as administrator via Task manager

Via Task Manager (standard)

Running the Command Prompt as administrator via the Windows Task Manager (standard way).

💡 Suitable: Windows 10, Windows 8, Windows 7.

  1. Call Task Manager (Ctrl+Shift+ESC);
  2. Click on the File;
  3. Click Run New Task;
  4. Select the Create this task with administrative privileges check box;
  5. Type cmd and click OK.

Via Run menu

💡 Suitable: Windows 10, 8.1, 7.

Open the Run menu.

  1. Press the Windows+R key combination (or right-click on the Start button, select Run);
  2. Enter the cmd command;
  3. Press the keyboard shortcut Ctrl+Shift+Enter.

Run the Command Prompt as administrator via Windows 10 Search.

💡 Suitable: Windows 10.

  1. Press the combination Windows+S (or right-click the Start button, select Search);
  2. In the search bar write the command prompt (the result will be displayed earlier than you type completely);
  3. In the right part of the window, select Run as administrator.

From Windows folder

Running cmd.exe from the utility location folder is another way to run the command prompt as administrator.

Читайте также:  Kms активатор windows 10 удаляется

💡 Suitable: for all versions of Windows.

  1. Open the System32 folder to the Windows folder (usually C:\Windows\System32);
  2. Right-click on the cmd file and select Run as administrator.

Via PowerShell

Another way to run Command Prompt as administrator is from PowerShell.

Run the command in the PowerShell console:

🟢 This article discussed how to run Command Prompt as admin Windows. I hope you were able to run the Command Prompt as as administrator with the chosen method. However, if you encounter any problems when starting the command prompt, feel free to write in the comments. I will try to help.

Open CMD as admin with Windows+R shortcut

My preference for running CMD is to use Windows + R » type cmd » Enter .

But this doesn’t open it with admin rights. Is there a way to type your way through to command prompt with admin rights?

7 Answers 7

The easiest and quickest solution that follows your method, is by starting the command prompt as follows:

Press win to open the start menu. Type in cmd to search for Command Prompt.

Press ctrl + shift + enter to launch Command Prompt as administrator.

This works from Windows 7 and up.

win+r does not natively support this though, but an alternative (and less quick) way, is to type in runas /user:Administrator cmd and then type the password for the administrator account.

EDIT: It seems that the latest version of Windows 10 does offer support for ctrl + shift + enter at the Win+R dialog, so you can now use it there too.

Another fast way is to use Windows + X then hit A .

However I marked the other answer as the correct one because the question originally asked for a way to do that through Windows + R

a simple answer:

  1. create a shortcut (LNK) to cmd.exe
  2. right-click the shortcut > properties > advanced > [v] run as administratir
  3. move the shortcut to a directory on the PATH

now: Win+R > admin > simply hit ok or enter.

nice to have

  1. UAC auto-click. it’s possible, but WAY out of this scope (and a security break), so I’ll press manually Alt+y.
  2. system-wide keyboard shortcut that links to this shortcut (or alternative command) directly. I’m using Win+Alt+C

alternative (external) commands

(Tested on windows 7)

In Windows 10, you can also type cmd in Run window, press Shift + Ctrl + Enter, instead of just pressing just enter. It will ask for permission & cmd will be in Administrator mode.

Читайте также:  Windows systems config system

To run cmd as administrator through Win+R without additional password typing (but UAC warning is still in-place though) just use the following trick:

If you want to get an access to cmd by clicking a shortcut:

  1. Create a shortcut for cmd (C:\Windows\System32\cmd.exe)
  2. Right-click the shortcut > Properties
  3. Find «Target» field on «Shortcut» tab
  4. Replace the target value with C:\Windows\System32\cmd.exe /C powershell «Start-Process cmd -Verb RunAs»

Hope this helps.

Another solution is:

  1. Right click task bar
  2. Open Task Manager
  3. Click More details option (it will show the menu bar)
  4. Click File -> Run new task
  5. Enter cmd and select Create this task with administrative privileges check box

The best solution for me (W10):

1- Pin the taskmanager In Taskbar : C:\Windows\System32\Taskmgr.exe

Press Ctrl + Shift + Esc , richt click on the taskmanager in the taskbar and select «Pin to taskbar» and close the taskmanager.

2- Press Ctrl + Shift + Click on the pinned taskmanager

3- Type the administrator and password account

4- Click on File -> Run new task

6- Enter «cmd» and select «Create this task with administrative privileges.» check box

How do you run a command as an administrator from the Windows command line?

I have a small script that performs the build and install process on Windows for a Bazaar repository I’m managing. I’m trying to run the script with elevated, administrative privileges from within the Windows shell (cmd.exe)—just as if I’d right-clicked it and chosen Run as Administrator, but without using any method that requires use of the graphical interface.

8 Answers 8

A batch/WSH hybrid is able to call ShellExecute to display the UAC elevation dialog.

Press the start button. In the search box type «cmd», then press Ctrl + Shift + Enter

All you have to do is use the runas command to run your program as Administrator (with a caveat).

In my case, this was

Note that you must use Quotation marks, else the runas command will gobble up the switch option to cmd.

Also note that the administrative shell (cmd.exe) starts up in the C:\Windows\System32 folder. This isn’t what I wanted, but it was easy enough to pass in the current path to my installer, and to reference it using an absolute path.

Caveat: Enable the admin account

Using runas this way requires the administrative account to be enabled, which is not the default on Windows 7 or Vista. However, here is a great tutorial on how to enable it, in three different ways:

I myself enabled it by opening Administrative Tools, Local Security Policy, then navigating to Local Policies\Security Options and changing the value of the Accounts: Administrative Account Status policy to Enabled, which is none of the three ways shown in the link.

Читайте также:  Linux командная строка dns

How to Run Cmd as Administrator in Windows 8

Last updated on January 19, 2015 By Venkat

There is no conventional Start Menu in Windows 8 like to that of in Windows 7, which shows programs and files while typing in the search box, if you want run command as administrator in Windows 8, here is how you can do that.

Running command Prompt with Admin Privileges in Windows 8

1. Press Win key +F for metro search UI to appear

2. Click on Apps and type cmd in the search box under Search for Apps and press enter

3.cmd appears in the left pane, right-click on it and click on Advanced at the bottom and select run as administrator

Command prompt window opens running with admin privileges appears as shown on top in the screenshot.

Update 06/01/2012: Even easier method, follow the instructions below

Open Windows Explorer or My Computer ,and Open the C Drive

Now from File menu, select Open Command Prompt > Open Command Prompt as Administrator

To run cmd as administrator along with command?

Here is my code:

Is it possible to execute the command without using process.standardinput ? I try to execute command I’ve passed in argument but the command does not executes.

2 Answers 2

As @mtijn said you’ve got a lot going on that you’re also overriding later. You also need to make sure that you’re escaping things correctly.

Let’s say that you want to run the following command elevated:

First, if you just ran this command through Process.Start() a window would pop open and close right away because there’s nothing to keep the window open. It processes the command and exits. To keep the window open we can wrap the command in separate command window and use the /K switch to keep it running:

To run that command elevated we can use runas.exe just as you were except that we need to escape things a little more. Per the help docs ( runas /? ) any quotes in the command that we pass to runas need to be escaped with a backslash. Unfortunately doing that with the above command gives us a double backslash that confused the cmd parser so that needs to be escaped, too. So the above command will end up being:

Finally, using the syntax that you provided we can wrap everything up into a runas command and enclose our above command in a further set of quotes:

Run the above command from a command prompt to make sure that its working as expected.

Given all that the final code becomes easier to assemble:

Оцените статью