The RUNAS command is to run an application as another Windows user. Running the Command Prompt on Windows

The command line is a special program that allows you to control the operating system using text commands entered in the application window. Its interface is completely text-based, in contrast to the usual appearance of the operating system.

Performing actions using text expressions, of course, is not as convenient as clicking on icons on the screen, selecting menu items, or opening program windows. But sometimes it is simply necessary to open the command line, for example, when there are problems in the system, when working with network and equipment settings, or when calling system applications. Here are some examples of its use:

  1. The systeminfo command allows you to collect system information, including installed updates and network information. The graphical interface does not provide for receiving such data.
  2. chkdsk - checks the disk for errors and generates a report.
  3. sfc /scannow is a useful command to start scanning and repairing damaged files.
  4. ipconfig - allows you to find out the IP address of your computer in a split second.
  5. ping - check the network operation in case of problems with the router.
  6. help - the command line will display a list of possible commands with brief information about them.

These are just a few examples of the useful uses of this application. In addition, through the program window you can quite successfully work on the computer without using a mouse.

Switching methods

There are several options to open the Windows Command Prompt:

In versions higher than Windows 8, in order to apply this method, you need to click on the magnifying glass next to the user name.


You can also create a desktop shortcut and hotkeys for quick launch. You can create a shortcut like this:

  1. In the Explorer window, find the “Windows\System32” folder, right-click on the cmd.exe file in it, then “Create a shortcut” and select a name for it.
  2. Right-click on an empty space on the screen and find “Create shortcut” in the context menu. In the field that appears, type C:\Windows\System32\cmd.exe. Next, select a name and click OK.

Now you can assign hotkeys. Call the context menu of the created shortcut, click “Properties”, “Shortcut” tab, enter the required combination in the “Shortcut” field.

Please note that when launched using the shortcut, search box and Explorer, the command line is launched from the System32 folder, and using the “Run” item of the Start menu from the Users folder of your computer.

Opening with extended rights

Among the methods discussed, some allow you to enable the command line as an administrator. The fact is that even if you use the Administrator account in your current work, you do not have full rights to manage the system. This is done to improve reliability and reduce the risk of damage from malware.

For most users, the graphical interface proposed by the developers is enough to “communicate” with Windows OS - it is simple and intuitive. But for some purposes that the average user rarely encounters, it is more convenient to use the command line. How to start the command line on Windows?

First, let's figure out what the command line is. Command line (console) interface - text. The user enters certain commands from the keyboard, and the system executes them. The command line is used, for example, to trace the route to a website (server) or to check ping in case of Internet problems.

In Windows NT OS (Windows 2000 and higher) it is used command line interpreter cmd.exe, which replaced the outdated command.com interpreter, which was used in systems of the Windows 9x and MS-DOS family. The interpreter translates the text command into a form understandable to the system. Launching a command prompt in Windows means running the cmd.exe application.

To open the command prompt, you can use one of the following methods.

Click on the “Start” button. In the menu that opens, select Run. In the window that opens, in the Open line, enter the name of the program cmd.exe and click on the OK button or press the Enter key on the keyboard. In order to open the Run window, you can also use the key combination Win + R (Win is the key with the Windows logo in the bottom row of the keyboard).

You can open the command line in a more “traditional” way, by selecting it from the list of installed programs. To do this, again, click on the “Start” button, select the All Programs item in the menu, then the Standard item, and from the list of standard programs select the program we need - Command Prompt.

But running the command prompt this way may prevent you from running certain commands. To achieve this, you need to run the command line as an administrator. To do this, we “get” to the command line using the previous method (Start - All Programs - Accessories), but click on the phrase Command Prompt not with the left mouse button, but with the right one. A context menu will open. In it, click on the item Run as administrator. A dialog box may appear: “Do you want to allow the following program to make changes on this computer?” Feel free to click “Yes”.

In order not to perform the same manipulations every time you start the command line, you can configure automatic run as administrator. To do this, call the context menu in the same way as in the previous case, but instead of Run as administrator, select Properties. In the properties dialog box that opens, go to the Shortcut tab and click on the Advanced button. In the window that opens, check the box next to Run as administrator, click OK, and in the properties window click Apply and OK.

Windows 7 includes extensible command line interface shell, Windows PowerShell. It can be used instead of the standard command line. Launching Windows PowerShell is as easy as running a regular command line (cmd.exe): Start - All Programs - Accessories - Windows PowerShell.

By running the command line, you can see list of most frequently used commands. To do this, enter the help command and press the Enter key. A list of available commands will open. To get more information about a command you're interested in, type help command_name, for example, help tree. If you need to get information about a specific utility, the utility_name /? construct will help, for example, ping /?.

Command line - quite a useful Windows tool, which can be useful in various situations. And the next time the provider's technical support representative asks you to open the command line and check the ping, you will not have the question “How to open the command line?”

    Team RunAS used to run an application under a user account whose name is passed as a command line parameter. In Windows 7 and later, this command, with standard security settings, does not allow you to gain administrative privileges, as happens in the "Run as Administrator" mode. To run the application as an administrator, you will need to perform some system settings. A universal way to run applications and batch files as an administrator without prompting UAC using the standard Task Scheduler is described in the article

RUNAS command line format:

RUNAS [ ] /user: username program

RUNAS [ ] /smartcard program

RUNAS /trustlevel: program trust level

Command line options:

/noprofile- Do not load user profile. This results in the app loading faster, but may cause some apps to not work properly.

/profile- Load user profile. This option is set by default.

/env- Use current environment settings.

/netonly- Credentials are for remote access only.

/savecred- Use credentials saved by the user. This option is not available in Windows 7 Home or Windows 7 Starter editions and will be ignored.

/smartcard- A smart card is used to provide credentials.

/user- username must be in the form USER@DOMAIN or DOMAIN\USER

/showtrustlevels- Display a list of trust levels that can be used as arguments to the /trustlevel parameter.

/trustlevel- The value "trust level" must be listed in the list of trust levels.

program- Command line for EXE. See examples below.

Examples:

runas /user:mymachine\administrator cmd.exe- run the command interpreter cmd.exe as the user "administrator" of the computer "mymachine". When executing the command, you will be prompted for the password of the user on whose behalf the task should be executed.

runas /noprofile /env /user:mydomain\admin " mmc %windir%\system32\diskmgmt.msc "- launch the mmc console with the Disk Management snap-in as the user "admin" in the domain "mydomain". The user profile is not loaded and the current environment variables are used. Loading a user profile is only necessary when there will be a task running that requires any data from it. If the "/env" parameter is specified, then environment variables are inherited from the current user's environment.

runas /savecred /user:admin@mydomain regedit.exe- run the registry editor "regedit.exe" as the user "admin" of the domain "mydomain" and remember the entered password. If the "/savecred" parameter is present, the entered password is stored in the registry in encrypted form and will not be requested in the future.

runas /showtrustlevel- display the levels of trust that exist in the system. The response will display a list like:

The following levels of trust are available in the system:
0x20000 (Regular user)

In addition to the trustlevel value equal to 0x20000 you can use the values 0x10000, corresponding to the minimum set of privileges and 0x40000, the standard set for this user. To view the differences between different trust levels, you can use the command Whoami, executing it in a shell session launched with each of the levels trustlevel

runas /trustlevel:0x20000 cmd.exe- run cmd.exe command processor using the trust level obtained in the previous example.

runas /trustlevel:0x40000 cmd.exe- run cmd.exe command processor using the standard trust level.

Note: In a command line session started using the /trustlevel parameter, the list of privileges corresponding to each trust level can be obtained using the command whoami/priv, and full account information is whoami/ALL

Note: parameter /profile incompatible with parameter /netonly.

Note: parameter /savecred incompatible with parameter /smartcard.

To run applications as administrator using runas.exe you need to change the default system security settings:

Enable the Administrator account (by default, it is disabled);

Set a password for the user Administrator;

To check for administrator rights, a batch file named who-admin.bat the following content:

WHOAMI/PRIV | find /i "SeRemoteShutdownPrivilege"

If %ERRORLEVEL% == 0 goto admin

Echo NOT have admin rights!

ECHO!!! ADMIN!!!

The principle of privilege analysis is based on the use of the command whoami with parameter /priv. Depending on whether you have administrator rights, the batch file displays the message “NOT have admin rights!”, or “!!! ADMIN !!!” and waits for a key to be pressed on the keyboard. Details can be found in the team description. whoami follow the link from the full list of commands.

runas /savecred /user:Administrator C:\scripts\who-amdmin.bat- run the batch file as administrator who-amdmin.bat, located in the C:\scripts folder. At the first launch, you will be prompted for the Administrator password, at subsequent launches (with the parameter /savecred) - no password required.

Passwords that are remembered when using the RUNAS.EXE utility with the /savecred parameter can be changed or deleted using the Saved Password Management snap-in:

%systemroot%\system32\rundll32.exe" keymgr.dll,KRShowKeyMgr

When typing key values, you must respect the case of characters.

To manage saved accounts in the Windows command line, use the utility CMDKEY.EXE

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 “Local users and groups” - “Users”. As you can see, in my case the “Administrator” account is disabled (there is an arrow on the icon).

Double-click to open the account properties and uncheck the “Deactivate account” option.

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 “Administrator” account and select the menu item “Set password...”

When prompted to change your password, click “Continue” and enter your 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, to do this, click “Start” - “Run”, or the key combination “Win ​​+ R” and enter the command cmd. In the window that opens, write the following:

runas /profile /user:mymachine\Administrator cmd

(where mymachine 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, that's what I did

You can now log out and log back in with 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. You can now browse directories, delete files, and even run applications as an administrator.

faqpc.ru

How to run Windows 7 command line with administrator rights?

Running Windows 7 Command Prompt with Administrator Rights

The principle of the command line is that it allows you to perform tasks without the help of the windows GUI. Typically, the command line is only used by advanced users.

Often, to maintain Windows 7, you have to go to the command line, and you need to perform tasks in the context of administrator account rights.

So, how to launch the command line with administrator rights in the Windwos 7 operating system? There are several simple and effective options to accomplish this task. Let's look at them.

Option number 1 - launch the command line through the START menu

  1. Open the Start menu and enter "cmd" in the search bar;
  2. Right-click on the search results and select "Run as administrator";
  3. The Windows 7 command line will start with administrator rights!

Option No. 2 - by creating a shortcut indicating the parameters

  1. On the desktop, call up the context menu with the right mouse button, select “Create” - “Shortcut”;
  2. In the file location line, write “cmd.exe” and click “Next”, then “Finish”;
  3. Right-click on the created shortcut and select “Properties”;
  4. In the properties window, click the "Advanced" button;
  5. In the additional properties window, check the "Run as administrator" box, then click OK;
  6. Now, when you launch the shortcut, the Windows 7 command prompt will launch with administrator rights.

I would like to note that to run the command line as an administrator in Windows 10, a special tab has appeared in the Start context menu. Read the life hack on the website by following the link provided!

Cmd4Win.ru

Command line for administrator in windows 7

In Windows 7, a regular user cannot even sneeze without permission. What can we say about the command line, which you often have to work with system administrator rights. There are several ways to open a command prompt with these rights.

As usual, in Windows in general and in Windows 7 in particular, the same action can be performed using a variety of methods. So let's see how to open the command line with administrator rights.

Method 1

Click the Start button and type cmd. The cmd.exe file will be shown at the top of the window. Right-click on it and select Run as administrator.

Method 2

Click the Start button and type cmd again. After that, press the key combination. The command prompt will open immediately in administrator mode.

Method 3

Click the Start button and select All Programs > Accessories.

Method 4

Well, this method is universal and will be needed if you are already working with an administrator account.

Select Start > Run or press a key combination.

windata.ru

8 ways to open cmd as administrator in windows 10

Hello, my curious readers!

Today in our article we will talk about the command line (cmd.exe) in Windows 10. The command line allows you to perform a variety of tasks that are not always possible to perform through the graphical interface. And when working in cmd, elevated rights may often be required. Now we will learn 8 ways to open cmd with administrator rights in Windows 10. This does not mean that these methods will not work in other versions of Windows. I personally tested all the methods described below to open cmd with administrator privileges on Windows 10 and they are fully working. If you have windows 7 or 8, then check them on your system.

So, let's go!

1. Launch cmd from the Start context menu

Right-click on Start or press the Win+X combination, and the keys are faster, I guarantee it;) A context menu will appear in which we select Command Prompt (Administrator). Ready!

2. Via task manager

If you have Task Manager running, you can open cmd directly from it. To do this, go to the menu File -> Run new task.

Enter cmd and check the box just below Create a task with administrator rights. And then OK.

3. Through the task manager (the tricky way)

The third method is very similar to the second, but a little faster and not so well known.

The beginning is the same, that is, in the Task Manager we select File -> Run a new task, but when you click on this item, hold down the Ctrl key. In this case, cmd is immediately launched in administrator mode, without unnecessary conversations.

4. Launch cmd from windows 10 search

Press the Win+S combination or aim with the left mouse button at the magnifying glass icon to the right of the Start button. In the search field, you can enter either in English ‘cmd’ or in Russian, enter the first 5-6 letters of the name ‘Command line’. Then right-click on the search result and select Run as administrator.

5. Launch cmd from the All applications menu

Open Start, click on All applications and look for System - Windows. It's usually hidden at the very bottom, so scroll your mouse wheel all the way to the bottom.

So, we found the System tools group, opened the list of programs inside and found the Command Prompt. Right-click on it, then Advanced, then Run as administrator.

6. Run from the windows\System32 system directory

You can launch the command prompt directly from its native system32 folder. To do this, go to Explorer / My Computer, find drive C, look for the windows folder, go there, find the System32 folder, go deeper and deeper into the rabbit hole and go into it. In the System32 folder we look for the cmd.exe file. Let's highlight it. And here two options appear.

The fastest and easiest: right-click on cmd.exe and select the already familiar Run as administrator.

The other option takes a little longer. When you select a file, Application Tools appears at the top. Click there with the left mouse button, another menu appears at the bottom, click on Run as administrator.

7. Launch cmd from any Explorer folder

This option for opening the command line is available from any folder in Windows 10 Explorer. Go to the location you need, go to the menu File -> Open Command Prompt -> Open Command Prompt as Administrator.

8. Create an admin shortcut for cmd.exe

To quickly access the admin command line, do the following.

On an empty space on the desktop, right-click and select New -> Shortcut.

Enter cmd or cmd.exe, both options will work. Further.

Name the shortcut so that it is immediately clear, for example, cmd.exe (admin). Ready.

The shortcut has been created but not yet configured. Go to its properties (right-click on the shortcut and select Properties). Click the More... button

... and check the Run as administrator box. We save this whole thing and now we can always launch the cmd command line with administrator rights by simply launching the shortcut.

But you can speed up the launch even more ;)

Right-click the shortcut and select Pin to taskbar. Or Pin to Start screen as an option.

I have described here exactly those options that allow you to launch the command line with admin privileges. There are still ways to launch, but they are on behalf of a regular user, which does not fit into the topic of this article. For example, via Win+R or hold Shift when right-clicking on an application.

As you can see, the same action in Windows can be performed in different ways. Depending on the current specific situation, I can choose the most appropriate cmd launch option.

Were you familiar with all these methods? Or were some of them new?) Tell us in the comments.

softwarius.ru

Run command line (cmd) with administrator rights

Running Command Prompt as an administrator on Windows in elevated mode is not a difficult task. Some useful commands require execution with such privileges. If you open them normally, then you will most likely see an error message.

It is advisable to have administrative access to Windows or know the admin password. When you try to call cmd as a user with limited rights, then a UAC window will open. Here you must enter the administrator password in the form; if entered correctly, you will launch a command line with administrator capabilities.

How can I find out what mode the console is open in? Look at the title of the window, if it says “Administrator”, then you have done everything correctly and can safely start writing commands.

There are many ways to launch the console as an administrator, and they are almost identical in different versions of Windows. All methods can be used equally.

Open a command prompt with administrator privileges on Windows 7

Familiarize yourself with the process of calling the command line in Windows 7 and select for yourself a convenient way to launch cmd. For example, consider the shortcut:

1. Click "start".

2. Place “command line” in the search.

3. Wait for the list to be built. Place the mouse cursor on the very first object and right-click.

4. A menu will pop up, in it select the line “run as administrator”.

Running Command Prompt as an administrator on Windows in elevated mode is not a difficult task. Some useful commands require execution with such privileges. If you open them normally, then you will most likely see an error message.

It is advisable to have administrative access to Windows or know the admin password. When you try to call cmd as a user with limited rights, then a UAC window will open. Here you must enter the administrator password in the form; if entered correctly, you will launch a command line with administrator capabilities.

How can I find out what mode the console is open in? Look at the title of the window, if it says “Administrator”, then you have done everything correctly and can safely start writing commands.

There are many ways to launch the console as an administrator, and they are almost identical in different versions of Windows. All methods can be used equally.

Open a command prompt with administrator privileges on Windows 7

Familiarize yourself with the process and choose for yourself a convenient way to launch cmd. For example, consider the shortcut:

1. Click "start".

2. Place “command line” in the search.

3. Wait for the list to be built. Place the mouse cursor on the very first object and right-click.

4. A menu will pop up, in it select the line “run as administrator”.

5. If the User Account Control option is enabled, click yes.

Note: Enter the admin password if you see an input field, and then click “yes”.

Run cmd on Windows 8 with administrator rights

1. Press the "start" button.

2. Move to the right all the way.

3. Click on the magnifying glass icon.

4. In the form, enter cmd.

5. Right-click on the “command line” object.

6. In the menu, click Run as administrator, as in the screenshot.

7. In the User Account Control window, click “yes”.

Like all modern operating systems, XP also has this function. Follow the steps in the links and recommendations above.

As you can see, there are not many steps you need to do to launch the command line as an administrator. With these rights, you can execute any written command in cmd. For example, this way you will have the opportunity to easily and quickly and more.