How to set up smartphones and PCs. Informational portal
  • home
  • Reviews
  • Run the program as an administrator from the command line. Different Ways to Run Command Prompt as Administrator in Windows

Run the program as an administrator from the command line. Different Ways to Run Command Prompt as Administrator in Windows

Reading various tips and comments on IT forums, you can often come across expert advice starting with the words “run the command line as administrator.” Moreover, there are often situations when the user does not know how to do this and launches the command line in normal mode, which somewhat disavows its effectiveness. In this material, I will tell you how to launch the command line as an administrator on Windows 7.10, I will describe various methods of such launch, giving the reader the right to choose the most convenient of all those described.

As you know, the command line (also called the “console”) is a type of text interface with which the user gives any commands to the computer. Command line information is usually presented in text form, but there may be exceptions in the form of audio and graphical display forms.

At the same time, one of the advantages of the command line interface is low resource consumption - the command line consumes a minimum of memory, while its capabilities with the help of specialized commands are quite extensive.

The command line migrated to the Windows OS family from the outdated MS DOS operating system, and is now quite often used to perform template operations on a large number of files, obtain network statistics, and so on.

Hello, laeg - Filatov Alexander Sergeevich, I have an interesting offer for you, write to the address [email protected].

How to run Command Prompt as Administrator on Windows 7

So, how to open Command Prompt as Administrator in Windows 7? I offer the reader several simple ways to gain access to the console with administrative rights:

Method number 1. Using the Start button menu

Click on the “Start” button, select “All Programs”, then go to “Accessories”. We find “Command Prompt” there, right-click on it and select “Run” as administrator.”

Method number 2. Using the search bar

Click on the “Start” button, enter cmd in the search bar (do not press enter). A cmd shortcut will appear at the top of “Programs”, right-click on this shortcut and select “Run as administrator”.

Method No. 3. Use the search bar (second method)

In order to open the command line, click on the “Start” button, again write cmd in the search bar (do not press enter), and then press the combination Ctrl+Shift+Enter.

Method number 4. Run the executable file directly

Go to the Windows\System32 directory, find the cmd.exe file we need there (usually in Explorer it is displayed as the name “cmd” and a black icon), right-click on it and select “Run as administrator”.

How to Run Command Prompt as Administrator on Windows 10

If you are wondering “how to run the command line as administrator on Windows 10,” then have several solutions:

Method number 1. We use the key combination Win+X

The easiest way for Windows 10 users is to press the key combination we need Win+X (or right-click on the “Start” button), and select “Command Prompt (Administrator)” in the menu that appears.

Method number 2. Using the search functionality

Click on the “Start” button, type cmd in the search bar, right-click on the result and select “Run as administrator”.

Method No. 3. Using the system Explorer

Go to Explorer, click on “File” in the top left, click on the arrow to the right of “Open Command Prompt” and select the “Open Command Prompt as Administrator” option.

A couple more ways to launch the command line

You can also add a couple of simple tips for launching the console (with normal status).

Go to the desktop, move the cursor over a free area, and hold down the “Shift” key (do not press). Then right-click and select “Open command window” from the menu that appears.

You can also create a corresponding shortcut on the desktop (using the usual copying of the “Command Prompt” shortcut from Programs - Accessories to the desktop) and launch it from there. But, as for me, the first method is quite enough to quickly launch the console.

Video on playing command line in Windows

Above, I have listed a few simple tricks on how to launch the Command Prompt as an administrator on Windows 7 and 10. Typically, launching the console with administrator rights is just a couple of clicks, and you will almost immediately have access to the advanced functionality of the console. Use these options when working with software that requires maximum user rights to run - and you can avoid a lot of software errors and other similar problems.

In contact with

Often a situation arises when you need to run cmd with administrator rights. However, this is not so easy to do for an untrained user. The whole problem is that by default, cmd is launched as the current user; to run as an administrator, you either need to log into the system under the admin username, or do some trick.

There is a certain nuance that needs to be done before running the command line as an administrator. You need to check whether the administrator account is enabled, if it is enabled, assign a password to it. Now let's take a closer look.

First, you need to check whether your administrator account is enabled. To do this, open “ Computer management

go to the item “ Local users and groups” — “Users“. As you can see, in my case the account “ Administrator” is disabled (there is an arrow on the icon).

Double-click to open the account properties and uncheck the “ Disable account

Click “ OK“. The arrow from the admin account icon has disappeared, which means it is enabled. Now let's set a password. To do this, right-click on the account “ Administrator” and select the menu item “ Set password...

On the password change warning, click “ Continue” and enter the password twice

Ready! You now have an administrator account and know the password for it. Let's move on to the next stage.

Launch CMD with administrator rights

Open the command line by clicking “ Start” — “Execute“, or keyboard shortcut “ Win+R” and enter the command cmd. In the window that opens, write the following:

runas /profile /user:mymachine\Administrator cmd

(Where mymachine– this is the name of your computer)

and press Enter. The Command Prompt will ask you for an administrator password, enter it and wait for Command Prompt to launch with administrator rights. Everything would be fine, but after entering I got an error:

This error can appear in two cases. The first is that you entered the wrong password. Second, I have never logged in under an administrator account (my version).

You need to log out and log in as an administrator, so that's what I did

You can now log out and log in again using your account. Once you are logged in with your account, try running cmd again as an administrator.

And voila! A second command prompt window opened under the administrator account. Now you can browse directories, and even run applications as an administrator.

What is the command line? This is simply a software shell that allows you to control some PC functions through text requests. Moreover, previously this was the only way to perform this or that function. Now almost everyone uses a convenient interface, but the line remains, and it’s quite easy to use.

How to open the command line?

How to Open Command Prompt in Windows XP

In principle, the methods for opening the command line are similar. Differences can only be in the interface itself and the inscriptions. To open the command line in Windows XP, you can use the standard Start menu. Next follow “all programs” - “standard” - “command line”.

The same can be done with the WIN + R key combination. In the window that opens, enter cmd and click OK.

How to Open Command Prompt in Windows 7

Since the Windows XP operating system is somewhat similar to Windows 7, the methods are applicable in both cases. The only slight difference is that the standard menu method may not work since in Windows 7 the menu is slightly different. Then you can use the regular search. Just type cmd in the standard search.

How to Open Command Prompt in Windows 8

In Windows 8, you cannot use the standard menu, since it simply isn’t there. At the bottom of the desktop there is an icon - “all applications”. Click on it and look for the “command line” menu item.

You can also use the WIN+R key combination method.

How to run command prompt as administrator?

How to Open Command Prompt as Administrator in Windows XP and Windows 7

Running the Command Prompt with administrator rights in Windows XP, just like in Windows 7, is very simple. Through the standard “start” menu, launch the command line as described above and right-click on the item, select “run as administrator”.

You can do the same, but using the desktop. Create a shortcut and name it “cmd.exe”. Right-click on it and select “run as administrator.”

How to Open Command Prompt as Administrator in Windows 8

With Windows 8 things are a little more complicated. Here you can do this using the backend manager. And so we launch the task manager, click File and then Launch a new task. In the window that opens, enter cmd and just below check the box next to Create a task with administrator rights and click OK.

Through Explorer, open “My Computer” and select the local drive, then follow this algorithm: File->Open Command Prompt -> Open Command Prompt as Administrator.

The same can be done using the WIN + X keys. After pressing this key combination, a menu will appear in which we select the “command line (administrator)” item.

As you can see, each of these methods is quite simple and does not require special knowledge or skills.

The command line (console) allows you to run programs, configure your computer, and automate many computer management actions. By default it runs with user rights. This protects the system from accidental changes and inexperienced users who, through their actions, can disrupt the operation of the system.

Therefore, in cases where major changes need to be made to the system, the command line must be launched with administrator rights. This will give full access to all operations and files. With administrator rights, you can execute any command in the console.

In this article, we will look at several ways to run the command line as an administrator in the Windows 7 and Windows 10 operating systems. It is unlikely that you will need all of these methods at once, just select the ones that are most convenient for you and use them if necessary.

Launching the Command Prompt Using Search

In the context menu of programs there is always a “Run as administrator” function. This function can be used on behalf of an administrator. To do this, open the Start menu and enter the “cmd” command into the search. After the command line (the “cmd.exe” file) appears in the search window, you need to right-click on it and select “Run as administrator” in the context menu that opens.

It should be noted that search in the Start menu works the same in both Windows 7 and Windows 10. Therefore, this method can be used in both of these systems.

After this you will see a warning about . Click on the “OK” button and the command line will open in front of you.

Also, the command line can be launched as an administrator without calling the context menu. To do this, open the Start menu and enter the command “cmd” into the search. After the command line (file “cmd.exe”) appears in the search window, you need to press the key combination CTRL+SHIFT+ENTER.

Launch the command line using the program list

In the Windows 7 operating system, the Command Prompt can be found in the menu in the “All Programs - Accessories” section. To run it as an administrator, call the context menu and select “Run as administrator.” After this, you will see a warning about running the program as an administrator. Click on the “Ok” button and a command line will open in front of you.

Due to differences in the design of the Start menu, this method will only work on Windows 7.

Executing a CMD command using the Run menu

Another option for opening a command prompt with administrator rights is to execute the “CMD” command in the “Run” menu. To do this, press the Windows key combination-R, enter the command “CMD” and press CTRL+SHIFT+ENTER. You need to run the command this way. If you simply press ENTER or the “OK” button, the console will start in normal mode.

You can also open the Run window from the Task Manager window, which is opened using CTRL-SHIFT-ESC or CTRL-ALT-DEL. To do this, open the "File" menu and select the "Run new task" option.

After this, the “Run” window will appear in which you can enable the “Create a task with administrator rights” option. When using this option, the “CMD” command will be launched immediately with administrator rights.

This option will work on both Windows 7 and Windows 10.

Create a command line shortcut

You can use a shortcut to run Command Prompt as an administrator. To do this, call the context menu on the Desktop and select “Create shortcut”.

In the window that opens, you need to enter the “cmd” command and click on the “Next” button.

After that, you need to enter the name of the shortcut and click on the “Done” button.

As a result, a shortcut to launch the command line should appear on your Desktop. Now open the properties of this shortcut and click on the “Advanced” button.

After that, close all windows by clicking on the “OK” button. That's it, after this, when you run this shortcut, the command line will be launched as administrator. This startup method works the same in both Windows 7 and Windows 10.

Opening a Command Prompt Using Windows-X

The Windows 10 operating system has an additional menu with a list of useful system utilities. There, among other things, there is a command line with and without admin rights. This menu can be opened using the Windows-X key combination or by right-clicking on the “Start” button.

In some cases, the entire command line in this menu is the PowerShell console. If this is the case for you, then you can switch to using the classic command line. To do this, open the “Options” menu, go to the “Personalization - Taskbar” section and turn off the “Replace the command line with Windows PowerShell” option.

The Windows-X menu is only available in Windows 10, so this method is only for this operating system.

Opening a command line from a folder

It is unlikely that this method should be used, but the command line can be launched from the “Windows\System32” folder (or from the “Windows\SysWOW64” folder if you have a 64-bit version of the operating system). To do this, go to the system drive, open the “Windows\System32” (or “Windows\SysWOW64”) folder and find the “cmd.exe” file in it.

The file “cmd.exe” is the Windows command line. To run it with administrator rights, right-click on it and select the “Run as administrator” option. You can also make a shortcut to cmd.exe on your desktop.

The location of the cmd.exe file does not differ between versions of Windows. Therefore, this method will work in both Windows 7 and Windows 10.

How to understand that CMD is running as administrator

After you have launched the command line, you should make sure that you did everything correctly and that it is running as administrator. To do this, you need to pay attention to the title of the window; it should contain the inscription “Administrator”, it indicates that the console is running as an administrator.

If there is no “Administrator” sign, then the console is working normally, close the console and try opening it again. If that doesn't work, you can try another opening method.

In the Windows operating system, in certain situations, tools must be used with elevated privileges. This is necessary because of actions that lead to changes at the system level and ordinary users (not administrators) do not need this. In the article I will talk about run as administrator of any application on the computer.

When you launch programs with elevated rights, a window appears in which you need to confirm the launch -. Some users disable this feature altogether. Thus, the security of the computer is compromised. After all, if the UAC warning window does not appear, any malicious infection will be able to start from your computer as an administrator. “Bad” code and good luck.

To make it easier for users to run programs as an administrator, I have prepared a couple of methods.

Run as administrator using context menu

The context menu is called up with the right mouse button. Click on any program with the mouse and from the context menu click on the option. This opens the command line and other programs where elevated privileges are required.

Using the combination Ctrl+Shift+Enter when searching

When there is no tool on the desktop or in the Start menu, we turn to search. Any version of Windows is equipped with it, and in the tenth it is most convenient. Write some command, for example, cmd - command line. Having selected the result, simultaneously press the combination Ctrl+Shift+Enter. Simple way isn't it?

Additional Shortcut Properties

Let's say you are interested in the question... The icon is already located on the desktop as a shortcut, but you don't want to launch the context menu all the time. This problem can be solved.

Go to the shortcut properties (right mouse button and Properties) and go to the section "Additionally".

Additional options will open. There, check the box "Run as administrator". Now, when you run the program normally, it will always open with elevated rights.

Additionally! In the properties on the "Compatibility" tab there is an option "Run this program as an administrator." Also a useful thing.

Programs to run as administrator

There are the following programs: RunAs, AdmiLink, ExecAS.

RunAs Tool

It is part of Windows, so you can use it. To run it, just open the command line and enter the following command:

You will most likely be asked to enter a password. Be sure to enter it.


Let's create a shortcut on the desktop. Right-click on an empty area and select “Shortcut”. We write the same command as the location:

runas /user:PCName\UserName msconfig.exe

Give the shortcut a name and save it.

After launching the shortcut, a command line will open where you must enter the account password. When you enter the correct data, msconfig or the utility you selected will immediately launch.

In this situation, you or people with access to the PC will have to enter a password every time. This point can be solved by adding the /savecred parameter to the command, then the command will be like this:

runas /savecred /user:PCName\UserName msconfig.exe

If you are thinking about security, then it is better not to use such shortcuts with this option. It’s better to enter your password every time and not worry that some impudent person will use Windows tools without a password to please himself and to your detriment.

Using the ExecAS tool

Running as administrator is possible using the ExecAS program. After launch, a window appears asking you to enter account information (login and password), as well as the program name and path. After entering the data, click "Record".


Our guinea pig appeared in the ExecAS window. Close the program and open it again. The program we specified in ExecAS will immediately open. To add an additional application, you need to enter ExecAS.exe /S on the command line. (In this case, you need to be in the directory with the utility, for example, C:\ExecAS).


Having launched ExecAS, we add some other program. Close the tool and launch it again. The same window appears. But this is not convenient for us, so let’s move on to creating shortcuts:

We make two shortcuts with the following commands:

  • C:\ExecAS\ExecAS.exe 1
  • C:\ExecAS\ExecAS.exe 2

Numbers 1 and 2 correspond to the program number in ExecAS.

Having launched the shortcuts, we see that they were opened as administrator.

Using the AdmiLink utility

The utility specified in the title is a console utility, and after installation it will be located in the Windows directory.

We launch the tool and see a very convenient window with a Russian interface, so it will be easy to figure it out.

  • In the first field, enter the path to the file that we want to run;
  • The command line parameters in the second field are optional;
  • The third line will be filled in independently, if this is not the case, enter C:\windows\system32
  • Window display mode. Line 4 has 2 parameters:
    • SHOW – standard software launch with a visible window;
    • HIDE – software runs in the background;

Configuring parameters on the tab Account:

  • For the domain name, write the name of your PC, or NetBios and test.lan;
  • Username – can be selected by clicking on the button with three dots;
  • Account password and confirm.
  • After entering all the data, click the button "Test".

The utility will check the functionality of the information we specified. Press any key in CMD.

After a successful test, press the button “Generate AdmiRun launch key”. If you don't do this, then nothing will work.

  • Go to the “Link” tab and do the following:
  • Shortcut name- call by any name;
  • Catalog– indicate where the shortcut will be located;
  • Picture– select an image for the shortcut;
  • Press the button "Generate command line".
  • Now press the big button “Create Shortcut Now!”.

The icon will immediately appear on the desktop or directory you specified.

Let's try to launch the shortcut. If everything went well and the program was launched as administrator, then congratulations. Otherwise, actions at some step were performed incorrectly.

If you go to the properties of the shortcut and change the program in the “Object” field to another, it simply will not start. This is a little protection against malware.

Task Scheduler

Run the program as administrator, just use the tool "Task Scheduler". There is one nuance here - if you are not an administrator, you will not be able to use it.

Enter just two words in the search: “Task Scheduler” and open the result.In the window on the right, select the item "Create task".

Call it an appropriate name, let's say you are launching the command line, then you can call it CMD. Also check the box "Run with highest rights".

On the "Actions" tab, click the button "Create".

Select an action (in our case, launch the program).Click Browse and select the utility to launch.If you run the command line, the path will be: C:\Windows\System32\cmd.exe.Now click OK.

A new line has appeared on the “Actions” tab. Great, you can click OK.

Shortcut creation stage

Create a shortcut on the desktop and enter the following command:

schtasks /run /tn task_name in scheduler

scheduler_task_name is the name you gave at the very beginning of the task creation process.

Hurray, we made the shortcut, but that's not all. Go to its properties.

On the Shortcut tab, change the icon. Of course, you don't have to do this.

Addition to the task scheduler method

For, you can use the Elevated Shortcut utility. You take a shortcut or executable file and drag it onto the Elevated Shortcut icon.

Running programs from the command line

If you open the command prompt as an administrator using the above methods, then launching all programs from CMD will also allow you to open them with elevated rights. How to transfer an account to another computer

conclusions

We looked at a bunch of ways to run programs as an administrator. There are options where you need to enter a password - this is one of the safest solutions, because every time we enter a password, we don’t have to worry too much about losing some data. Virus programs will also not be able to launch Windows tools this way.

Best articles on the topic