Run CMD as LOCAL SYSTEM User

by Mark Berry 5/22/2009 5:24:00 PM

Zenith Infotech's SAAZ platform allow you to set up jobs to run on client machine, e.g. for installing software. The jobs run as user LOCAL SYSTEM. Deploying a SAAZ job can take 15-30 minutes, which is too long to wait between test runs. So how does one open a command prompt as user LOCAL SYSTEM for testing? Adi Otlean provides the answer near the end of this post:

  1. Open a command prompt and type
    sc create CmdSvc binpath= "cmd /K start" type= own type= interact
    sc start CmdSvc
    Attempting to start the service will fail with error 1053 because CMD doesn't have any service-related code. However it will also open a new CMD window running as LOCAL SYSTEM.
  2. Do your testing in the new CMD window.
  3. When you're done, you might want to get rid of the service:
    sc delete CmdSvc

Thanks Adi

Comments are closed

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen. Customized by Mark Berry.

About the author

Mark Berry Mark Berry owns MCB Systems, a firm active in both IT administration and database software development.

E-mail me Send mail
`

Tags

Disclaimer

The opinions expressed herein are my own personal opinions and absolutely represent my employer's views. I'm self-employed! Please keep in mind that what worked for me or someone else may not apply to your situation. Always have a good backup, and use any information here at your own risk!

Entire contents copyright © 2010 by MCB Systems. Sign in