Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Windows 11 / How to Run CMD/Program as SYSTEM (LocalSystem) in Windows

August 27, 2025

How to Run CMD/Program as SYSTEM (LocalSystem) in Windows

Sometimes, local administrator permissions may not be sufficient to manage certain system files, registry keys, processes, and services in Windows. In such cases, an administrator can take ownership of files/other objects or perform actions on behalf of the privileged SYSTEM (LocalSystem) account. In this post, we will cover how to open a command prompt or run any program as SYSTEM.

Disclaimer. Do not use running programs or commands under NT AUTHORITY\SYSTEM as a routine administrative practice. Careless actions with such elevated privileges can easily break your Windows system. In practice, most problems that require elevated permissions on Windows can be solved using standard methods, such as: runas, running an app without administrator privileges and suppressing the UAC prompt, taking ownership of files/registry keys, disabling UAC for all or only certain apps, granting service management privileges for non-admin users, etc.

Contents:
  • How to Run CMD/Process as SYSTEM on Windows Using PSExec
  • Configure a Task Scheduler to Run a Task as SYSTEM

 The built-in SYSTEM account is used by the SCM (Service Control Manager) to run and manage system services. Using the System account (it may also be called NT AUTHORITY\SYSTEM, Local System, or Computer\LocalSystem), most system services and processes are run (including the operating system NT Kernel). Open the Service Management mmc snap-in (services.msc) and note the services that have Local System in the LogOnAs column. These services are running under the SYSTEM account.

windows services running as localsystem

How to Run CMD/Process as SYSTEM on Windows Using PSExec

The easiest way to run a command or program as NT Authority\System is to use the Sysinternals PSExec.exe console tool.

The PSExec.exe is a tool included in the PSTools administrative utility suite. It is available for download on the Microsoft website https://docs.microsoft.com/en-us/sysinternals/downloads/psexec. The PSExec utility is familiar to any administrator and is used to run commands and programs on remote computers. PSExec also has a useful feature that allows you to run processes on behalf of the system. Some antivirus programs may identify PSExec.exe as a potentially harmful program.

The PSExec tool doesn’t require installation. Simply extract the PSTools.zip archive to a local drive (it’s likely that you’ll need to unblock the file you downloaded from the Internet before you can use it).

unblock psexec file in windows

Open the command prompt (CMD) in “Run as administrator” mode and navigate to the directory where the psexec.exe file is located:

cd C:\PSTools\

To run a program or command as SYSTEM, run:

psexec -i -s cmd.exe

The command to run PSexec from the PowerShell shell will look like this:

.\psexec.exe -i -s <executable>

  • -i – run the specified app in the interactive mode (a user can interact with the program on the desktop). If not specified, the process is launched in a console session.
  • -s – run process as Local System account
  • cmd.exe – the name of the EXE file, script, or command that will be run on behalf of the SYSTEM user.
The first time you run PsExec, you will be prompted to accept the license agreement.

psexec -s -s cmd - run as system

After executing the command, a new command prompt window will appear, running under the NT Authority\System account. Make sure it is true by running this command:

whoami

psexec: run cmd as system

Since in this example we launched the interactive console of the command-line interpreter cmd.exe under the SYSTEM account, all subsequent commands and programs started from this session will also run with SYSTEM privileges.

To run a program, command, or script with LocalSystem privileges, change the PsExec arguments from cmd.exe to the full path of the desired program’s executable file (enclose the path in quotes if it contains spaces).

Now, you will be able to change, rename, or delete system files or registry keys that are owned by TrustedInstaller or SYSTEM. For example, you can terminate a system service or close a file locked by a system process.

 Using PSExec, you can open an interactive command prompt with the NT AUTORITY\SYSTEM privileges on a remote computer. To do it, the following command is used:

psexec -s \\mun-b21pc12 cmd.exe

If the Couldn’t install PSEXESVC service error appears, make sure that:

  • The command prompt is run as administrator
  • Another PSEXESVC service instance is not running PSEXESVC service
There are also several third-party tools that can be used to run programs on behalf of the System account (like AdvancedRun, RunAsSystem, PowerRun), but I don’t see the point of using them. Firstly, these are third-party tool, so you cannot guarantee that their code is free of malicious bookmarks. Secondly, Microsoft’s official PsExec utility is perfectly capable of completing the task.

Configure a Task Scheduler to Run a Task as SYSTEM

The Task Scheduler can be used to periodically execute certain scripts or commands on behalf of the system. For example, I want to run a particular PowerShell script with system privileges when Windows boots.

  1. Open the Task Scheduler console by running the taskschd.msc command
  2. Create a new task PSscriptAsSYSTEM
  3. In the User field, click the Change User or Group button and type SYSTEM (the account used to run task will change to NT AUTHORITY\SYSTEM)
  4. Enable the Run with highest privileges optionrun sheduled task as system
  5. Go to the Triggers tab and select when you want to run your script (in this example, the task will run At startup)trigger: run task at startup
  6. On the Actions tab, specify which program you want to run.
  7. In this example, we will run a PowerShell script (*.ps1). To do this, specify in the Program/Script field: powershell.exe . In the Arguments field, specify the path to the PS1 script file: -ExecutionPolicy Bypass -NonInteractive -File "C:\PS\MySampleScript.ps1" run powershell script from task sheduler as localsystem account
    Learn more about running PowerShell scripts from Task Scheduler.
  8. Save the task settings
  9. To activate a task, right-click on it and select Enable.

Each time Windows boots, the Task Scheduler will run the specified PowerShell script with SYSTEM privileges.

This method of running elevated jobs via Task Scheduler is suitable for apps that don’t require user interaction or input.

If you only need to run a program or command on behalf of SYSTEM once, you can skip creating a trigger for a scheduled launch. Instead, run the scheduler task manually by selecting it in the console and clicking Run.run once task as system

In Windows XP and Windows Server 2003 (which are no longer supported), there was a trick to open an interactive command prompt with SYSTEM account privileges using the scheduled task. It was enough to open the command prompt under the admin account and run the following command:

at 10:23 /interactive cmd.exe

where, 10:23 is the current time plus one minute (in the 24-hour format). When the specified time comes, a command prompt window will open in the console session, running with Local System permissions

Newer Windows versions (including Windows 11) don’t support running the interactive command prompt using the AT command.

The AT command has been deprecated. Please use schtasks.exe instead.
Warning: Due to security enhancements, this task will run at the time expected but not interactively.
Use schtasks.exe utility if interactive task is required ('schtasks /?' for details).
The request is not supported.

can't run at on windows 10 - Use schtasks.exe utility if interactive task is required

3 comments
11
Facebook Twitter Google + Pinterest
PowerShellWindows 10Windows 11Windows Server 2022
previous post
How to Disable or Change User Account Control (UAC) Settings in Windows
next post
Zerologon (CVE-2020-1472): Critical Active Directory Vulnerability

Related Reading

PowerShell: Get Folder Size on Windows

April 2, 2024

Fix: The Computer Restarted Unexpectedly or Encountered an...

May 16, 2024

How to Download Offline Installer (APPX/MSIX) for Microsoft...

March 12, 2024

Windows Doesn’t Automatically Assign Drive Letters

March 15, 2024

How to Clean Up System Volume Information Folder...

March 17, 2024

Managing Administrative Shares (Admin$, IPC$, C$) on Windows

March 15, 2024

How to Upgrade Windows Build from an ISO...

November 7, 2024

Software RAID1 (Mirror) for Boot Drive on Windows

February 24, 2025

3 comments

gommet granger May 11, 2022 - 9:23 am

you do know that psexec isnt from microsoft its from sysinternals right?! lmmfao

Reply
admin May 12, 2022 - 7:48 am

Microsoft acquired Sysinternals and its assets on July 18, 2006

Reply
Pete Mitchell June 17, 2022 - 5:23 pm

Oh man, you failed so hard on that one.

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Proxmox: Share a Host Directory with VMs via VirtioFS

    August 18, 2025
  • How to Find AD Users with Blank Passwords (Password-Not-Required)

    July 24, 2025
  • Run Elevated Commands with Sudo on Windows 11

    July 16, 2025
  • Find a Process Causing High Disk Usage on Windows

    July 15, 2025
  • Fix: Microsoft Defender Not Updating Automatically in Windows

    July 8, 2025
  • Create a Windows Server VM on Proxmox (Step-by-Step)

    July 7, 2025
  • How to Detect Which User Installed or Removed a Program on Windows

    June 23, 2025
  • Encrypt Any Client-Server App Traffic on Windows with Stunnel

    June 12, 2025
  • Failed to Open the Group Policy Object on a Computer

    June 2, 2025
  • Remote Desktop Printing with RD Easy Print Redirection

    June 2, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Download Offline Installer (APPX/MSIX) for Microsoft Store App
  • Get-ADUser: Find Active Directory User Info with PowerShell
  • How to Hide Installed Programs in Windows 10 and 11
  • Using Credential Manager on Windows: Ultimate Guide
  • Managing Printers and Drivers on Windows with PowerShell
  • PowerShell: Get Folder Size on Windows
  • Protecting Remote Desktop (RDP) Host from Brute Force Attacks
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top