Run as windows 7. Various ways to run programs as another user. Run from the command line

04.08.2018 Computers

There are situations when you need to run a program on behalf of another user. It doesn’t matter why this was needed, the main thing is how to do it quickly, quietly, and without noise. Both the regular menu command and the specialized runas command will help us with this, which is discussed in this article.

The easiest way to run a program as another user is using the standard context menu, but with a little trick.

And the update goes wrong. The second group tries to automatically register for account administrator - it shouldn't be done this way. It's well thought out, but unfortunately too short. Calling the input prompt requires administrator rights, which the user no longer has. This is only possible with the help of the embedded system administrator. There are different solutions here.

Then you can use the following approaches to login to the administrator account and then set up a local account. Then try selecting the System Restore option and keep it running. With a little luck, the system recovers after a new login and the user account has administrator rights again.

Namely, we need to right-click on the program file, but with the key pressed first . As a result, the command will appear in the menu that opens Run as a different user.

Now just enter the name and password of the user you are looking for, and then click on the OK button.

Attention: Please note that you can run the program from another account only if this account has a password. Otherwise, nothing will work.

Then you should be careful to create a second local user with admin rights. Then restart the system and select “Activate Safe Mode” in the next window. The guest account can subsequently be upgraded to an administrator account as described in the blog post.

Tip 3: Recovering the Administrator Account

If tips 1 and 2 don't help, you can do one more trick. Once the above options appear, you need to select Command Prompt. Now comes the exciting moment. There the account administrator appears on your system, just type. The account does not have a password. It can also be to display the tooltip directly.

Let's say we need to regularly run a program as another user. Clamp every time I'm lazy. So let's create a shortcut.

Press and hold the key . Now, without releasing the button, drag the program file icon to the place where you want to create a shortcut, say, to another folder or to the desktop.

Now right-click on the shortcut and select the command Properties. We need a field An object, in which you should enter the following command:

Runas /user:account_program

Example below:

As you can see from the screenshot, we will use the runas command. It is used to launch programs with the rights of another account. Instead of a phrase "Account"(see example above the screenshot) you should enter the name of another account, with whose rights the program will be launched. Finally, instead of "program" You should enter the name of the program or command to run.

Attention: if the username is two words with a space between them, then in the command the name must be closed with quotes. For example, username fluffy without quotes or “ super fluffy” – respectively, with quotation marks.

If the program to be launched is not located in the system folder, then the path to it must also be specified in quotes. System folders are the Windows, Program Files, Documents and Settings folders.

And here's what the right command to use the administrator account, for which one of two options should be specified for the “user” value:

/user:admin_account@computer_name or /user:computer_name\admin_account

The runas command has other interesting parameters, take the time to find them out by running the following command on the command line:

As you can see, nothing complicated - just like a gingerbread. Or are there complex gingerbread cookies? Good question.

Probably everyone who works on Windows 7 or Windows 8 has encountered the issue of running an application as an administrator. Sometimes this function solves some problems with launching this or that software. If everything is clear with running as an administrator, then with running as another user things are a little different. The need for this type of launch may arise through a different set of rights that the program requires. About running programs on behalf of various system users and we'll talk in this article.

0. Different ways to run programs as another user

Let's look at 3 ways to run a program as another user in Windows 8:

1. Launch through Explorer using the context menu

The first method is the simplest. We need to find the program that needs to be launched on behalf of another user, right-click on it in Explorer, and then select the item we need in the context menu “ " Then a window will appear where you will need to provide user data (password and login). Click " Enter" and the program starts successfully.


But by default, point 3 Launch as another user" is not in the context menu, but this can be quickly and easily fixed. There are two ways to do this, which will be discussed below.

The first way is to simply click the " Shift» and call the context menu by right-clicking on the shortcut, the required item will immediately appear in the list.


The second method is more complex, for those who do not want to constantly hold down the " Shift" It consists of editing group policies. To begin, press the key combination Windows+R, in the window that appears, enter the command gpedit.msc and press the " Enter».


An editor window will appear in front of us; on the left in the settings tree we need to go to “ User Configurations» — « Administrative Templates» — « Start Menu and Taskbar" and find the item (located almost at the end) " Show "Run as different user" command».


Double-click on the line and set the switch to “ Included" and click " OK» to save changes.


To apply the changed policy, all that remains is to restart the computer (or re-login to Windows under the given user) or again call the “ Execute» ( Windows+R) and write the command in it gpupdate /force. In this case, a small window will appear saying “ Policy Update", and after a few seconds the changes will take effect. Now the command will always be displayed in the context menu for this system user.

2. Launch through Explorer using the Metro interface

Another way to run a program as another user is to run it using the new Metro interface. The algorithm of action is the same. Click on the required program with the right mouse button while holding down the " Shift" In the action menu, select " Run as a different user».


Again, in order for this item to be always available, you need to enable the “ Run as any user» Group Policy for the context menu. (see previous paragraph).

3. Run from the command line

The last method is to run the program as a specified user from the command line. To do this, call up the window “ Execute" (or command line) and in the field " Open"Let's write a command like:

Runas/user:<Username> <Path_to_executable_file>

For example:

Runas /user:Onyanov "C:\Program Files (x86)\1cv82\common\1cestart.exe"


After executing this command, a window will appear asking you to enter a password for this user and, if the password is successfully entered, the program will start on behalf of this user. You should also remember that if the account name or path to the executable file contains spaces, it should be enclosed in quotes.

Did this article help you?