Windows run file as user

5 простых способов запуска программы в Windows 10 от имени другого пользователя

Во всех поддерживаемых версиях Windows существует возможность запускать в текущей сессии программы от имени другого пользователя ( Run As ). Благодаря этому можно выполнить скрипт (.bat, .cmd, .vbs, .ps1), исполняемый .exe файл или запустить установку приложения (.msi, .cab) с полномочиями другого пользователя (привелигированного).

К примеру, благодаря возможности использовать функционал Run As можно в сессии пользователя с ограниченными правами запустить установку программы или открыть нужную MMC оснастку управления компьютером под административной учетйно записью. Также возможность запуска программы «от имени» может быть полезна в ситуациях, когда приложение настроено под другим пользователем (и соответственно хранит свои настройке в чужом профиле, к которому у данного пользователя нет данных), а его нужно запустить с теми же настройками в сессии другого пользователя.

В Windows 10 есть несколько способов запустить процесс от имени другого пользователя.

Запуск программы от имени другого пользователя из Проводника (File Explorer)

Самый простой способ запустить приложение под другим пользователем – воспользоваться графическим интерфейсом Проводника Windows (File Explorer). Просто найдите нужно приложение (или ярлык), зажмите клавишу Shift и щелкните по нему правой кнопкой мыши. Выберите пункт контекстного меню « Запуск от имени другого пользователя » (Run as different user).

Примечание . Если пункт меню « Запуск от имени другого пользователя » отсутствует, см. следующий раздел.

В появившемся окне нужно будет указать имя и пароль пользователя, под чьей учетной записью нужно запустить приложение и нажать кнопку ОК .

Примечание . Если нужно указать доменного пользователя, используется один из следующий форматов имени: UserName@DomainName или DomainName\UserName

Важно . Запуск программы от имени другого пользователя возможен, если для него задан пароль. Использовать Run as для учетки с пустым паролем не получится.

Откройте Диспетчер задач и убедитесь, что приложение запущенно под указанным пользователем.

Что делать, если отсутствует пункт «Запуск от имени другого пользователя»

В том случае, если у вас в контекстном меню отсутствует пункт Запуск от имени другого пользователя (Run as different user), откройте редактор групповых политик (gpedit.msc) и убедитесь, что в разделе Конфигурация компьютера -> Административные шаблоны -> Компоненты Windows -> Пользовательский интерфейс учетных данных (Computer Configuration -> Administrative Templates -> Windows Components -> Credential User Interface) отключена (Не задана) политика Запрашивать достоверный путь для входа в учетную запись (Require trusted path for credential entry) .

Утилита Runas:как запустить приложение от имени другого пользователя из командной строки

Запустить программу или скрипт от имени другого пользователя можно и из командной строки или ярлыка приложения. Кроме того, этот способ предполагает возможность сохранения пароля пользователя, чтобы его не пришлось набирать каждый раз. Для этого можно воспользоваться консольной утилитой runas.exe .

Откройте командную строку (или окно Выполнить, нажав сочетание клавиш Win+R ). Для запуска Блокнота под учетной записью admin выполните команду:

Читайте также:  Как создать файл определенного размера linux

runas /user:admin “C:\Windows\notepad.exe”

В отрывшемся окне появится приглашение «Введите пароль для admin», где нужно набрать пароль пользователя и нажать Enter.

How to Run a Program as SYSTEM (LocalSystem) Account in Windows

Many Windows system files, registry keys, and services are owned by the SYSTEM (a.k.a LocalSystem) account, which has a high privilege level. If you need to modify a registry key owned by the SYSTEM account, there are at least two options.

The first option that comes to your mind is to take ownership of the corresponding registry key, assign yourself Full Control permissions. Once the registry key or the values are updated, revert the permissions and ownership to SYSTEM .

There is, however, an easier option. You can run the program — e.g., the Command Prompt or the Registry Editor under the SYSTEM account directly and update the registry values.

This article lists six different methods using which you can run programs under the SYSTEM or LocalSystem account in any version of Windows, including Windows 10. You can also add a Run as SYSTEM right-click menu option for .exe files.

Method to run a program under the SYSTEM account:

Before proceeding, understand that the terms SYSTEM , LocalSystem , and NT AUTHORITY\SYSTEM are one and the same.

How to Run Programs as SYSTEM (LocalSystem account)

To run a program under the SYSTEM account, use one of the following tools:

Using PsExec.exe from Windows Sysinternals

Use PsExec.exe console tool from Microsoft’s Windows Sysinternals to run a program under the SYSTEM context. Follow these instructions:

  1. Download PsExec from Microsoft Sysinternals.
  2. Unzip and extract the tool to a permanent folder — e.g., d:\tools
  3. Open an elevated or admin Command Prompt window.
  4. To start the Registry Editor under the SYSTEM account, type the following command, and press ENTER :

The above PsExec command-line starts the Registry Editor under LOCALSYSTEM account so that you can modify protected areas in the registry.

Note: If you launch Command Prompt ( cmd.exe ) using PsExec.exe under the SYSTEM account, it spawns a new Command Prompt window. And, any program you launch from that Command Prompt window would run under the SYSTEM (LocalSystem) account, which is a high privileged account. You must be cautious when running programs under the SYSTEM account so that you don’t accidentally run an undesired program as SYSTEM .

Using Advanced Run from Nirsoft

AdvancedRun is a simple tool for Windows that allows you to run a program with different settings that you choose, including – low or high priority, start directory, main window state (Minimized/Maximized), run the program with different user or permissions, Operating system compatibility settings, and environment variables. You can also save the desired settings into a configuration file and then run the program automatically from the command-line with the desired settings.

Using Advanced Run, you also launch a program under SYSTEM or a different user context.

Type in the program name to run and choose SYSTEM user in the Run As dropdown box, and click Run.

You can also create a desktop shortcut to run a program as SYSTEM. Here is the command-line syntax you use:

/RunAs 4 instructs to start the program under the LocalSystem account. The possible value data for the /RunAs switch are below:

  • 1 – Run as current user (elevate)
  • 2 – Run as current user (no elevation)
  • 3 – Run as Administrator (force elevation)
  • 4 – Run as SYSTEM
  • 8 – Run as TrustedInstaller

This starts the program under the LocalSystem account, which you can verify in the Task Manager Details tab.

Run as SYSTEM via the right-click menu

To launch a program under the SYSTEM account (with Advanced Run) from the right-click context menu, make a .reg file from the following contents and run the file.

Change the path to AdvancedRun.exe in the .reg file if necessary.

This adds the Run as SYSTEM command to the right-click menu for .exe files and its shortcuts.

Using Process Hacker

Process Hacker is an excellent process manager that looks similar to Sysinternals Process Explorer. This tool has a unique feature that allows you to launch a program under the same account as a running process or service.

  1. Run Process Hacker as administrator.
  2. Locate a program or service which is currently running under NT AUTHORITY\SYSTEM .
  3. Right-click on the process, click Miscellaneous, and click Run as this user…
  • Select the program (e.g., regedit.exe, or cmd.exe) you want to launch as that user.
  • Click OK.
  • Now the program (e.g., cmd.exe) would run as SYSTEM ( NT AUTHORITY\SYSTEM )

    The above method can also be used to launch any program under TrustedInstaller.

    Using NirCmd.exe from NirSoft

    NirCmd is a multipurpose command-line tool which we’ve covered in this site before.

    NirCmd can start a program elevated as well as launch it under the SYSTEM account.

    Use this command-line to start the Registry Editor elevated and under the SYSTEM account:

    Context menu implementation

    Make a .reg file from the following contents and run the file.

    Using RunAsSystem from Uwe Sieber

    RunAsSystem (from Uwe Sieber) is a console tool that launches a program under the SYSTEM account or context. It also passes the window style and its process priority to the executed process by default. You can override the window size as well as the child process priority using command-line arguments. Uwe Sieber is the one who developed the famous USB Drive Letter Manager program.

    It waits for the started process to end and then passes back its return code (aka errorlevel). However, in a batch file, you have to add start /wait .

    Usage:

    Examples:

    Context menu implementation

    Make a .reg file from the following contents and run the file.

    The above .reg file adds a Run as SYSTEM command in the right-click menu for .exe files. The .reg file assumes that the file RunAsSystem.exe is placed under the d:\tools folder. If not, alter the path accordingly in the .reg file.

    Using “NSudo” from M2Team

    NSudo (GitHub) is a similar portable utility like Advanced Run, except that it is not digitally signed. It can launch programs under SYSTEM, Current User, Current Process, or the TrustedInstaller account. We’ve earlier seen how to use NSudo to launch programs as TrustedInstaller.

    Select the mode (System) from the dropdown, type in the executable path, and click Run.

    Optionally, you can also add a predefined set of programs or commands in the Open: drop-down list box by editing the file named NSudo.json located in the same folder as the executable.

    To run a program under the SYSTEM context using NSudo command-line, use this syntax:

    See below for the full list of command-line arguments supported by this utility.

    NSudo: Command-line support

    Context menu addition

    • Run NSudo with -Install parameter. It copies NSudo to the Windows directory and adds the context menu.
    • To remove the context menu, run NSudo with the -Uninstall parameter. It removes NSudo from the Windows directory and the context menu.

    Editor’s Pick: Advanced Run for GUI (and CLI), and PsExec for CLI.

    One small request: If you liked this post, please share this?

    About the author

    Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and he has been a Microsoft Most Valuable Professional (MVP) for 10 consecutive years from 2003 to 2012.

    Microsoft → Windows → How to Run a Program as SYSTEM (LocalSystem) Account in Windows

    2 thoughts on “How to Run a Program as SYSTEM (LocalSystem) Account in Windows”

    This is a really useful article and information. Thank you for that!

    I use this feature at the login screen by renaming a few files while Windows is offline. While this is a handy feature for technicians like myself, shouldn’t this be a security issue that Microsoft addresses?

    How to Run as different user in Windows 10

    In Windows 10/8/7 you can perform both actions – Run as an Administrator and Run as different user, easily. In this post, we will show you how you can Run a program as a different user.

    Run as different user

    To Run a program as a different user, simply press the Shift key and right-click on the shortcut or executable you wish to Run as different user.

    From the right-click context menu, select Run as different user.

    This is useful when you want to use the “Run as” feature to start a program as an administrator, when you are logged on as a member of another group, such as the Users or Power Users Group and so on.

    On Windows Server however, Shift+Right-click does not offer the option Run as a different user!

    It is offered in Windows 10, Windows 8, and Windows 7. It was also offered in Windows XP, but not in Windows Vista.

    If you wish you can add this Run as different user command permanently to your regular right-click context menu by downloading and running ShellRunAs from Microsoft.

    This RunAs utility is handy for launching programs under different accounts, but it’s not convenient if you’re a heavy Explorer user.

    Password Recovery

    How can you run a script or application as another user? In this tutorial we’ll show you 3 ways to run apps as different user in Windows 10.

    Method 1: Shift + Right-Click Context Menu

    Open File Explorer and browse to the executable file you wish to run as different user. Simply hold down the Shift key and right-click on the executable file, select Run as different user from the context menu.

    Next you have to enter the user name and the password of the user which we want use to open the application.

    Method 2: Run as Different User via Command Line

    Runas is a very useful command in Windows. This command allows to run applications under a different user account, even as an Administrator. To use the Runas command, you need to provide a different user’s credentials and the full path of the application you want to run.

    For example, if you want to open Notepad as your Windows user Bob, the command line would be as below.
    runas /user:Bob “C:\Windows\notepad.exe”

    After running the above command, you will be asked to enter the password of Bob account. After password validation, Notepad will be opened with the specified account credentials.

    Method 3: Run as Different User via Start Menu

    If you want to run apps as different user from Start Menu in Windows 10, you need to tweak the Group Policy setting.

    1. Press the Windows + R key combination to bring up the Run box, type gpedit.msc and hit Enter.
    2. In the Local Group Policy Editor window, navigate to:
      User Configuration\Administrative Templates\Start Menu and Taskbar
    3. In right-side pane, double-click on the policy called Show “Run as different user” command on Start.

    Set the policy to Enabled, then click OK to save your changes.

    Reboot your computer. Right-click any application on the Start Menu, you’ll see a new option “Run as different user” for quick access.

    Читайте также:  Удалить файлы нулевого размера linux
    Оцените статью