How to: Run Program as Local System Account

Running a Program or Batch file under different user account is one of the easiest way to impersonate a Program/Application with some other user’s privilege. For every administrators, this would be the common need either for testing or to impersonate different user privilege. In this article, I am going to write and explain about how to run a program or batch script under Local System account context.

You can execute or run a program under local system account by using sysinternals‘s Psexec utility. you can download at
http://technet.microsoft.com/en-us/sysinternals/bb897553. You can use the -s switch to run a program as the system account. The following example shows how to start a cmd.exe session under the system account:

C:PSTools> PsExec -s cmd.exe

PsExec v2.1 - Execute processes remotely
Copyright (C) 2001-2013 Mark Russinovich
Sysinternals - www.sysinternals.com

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:Windowssystem32>whoami
nt authoritysystem

C:Windowssystem32>exit
cmd.exe exited on HP-PC with error code 0.
How to Run Program or Batch file under Local System Account

Once you have completed the work you can revert to current user by executing exit command.

Thanks,
Morgan
Software Developer

Advertisement

Leave a Comment