Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

September 08, 2005 12:00 AM

How can I start a process or program as the local system account?

Windows IT Pro
InstantDoc ID #47673
Rating: (6)

A. In the FAQs, "How do I schedule commands?" (http://www.windowsitpro.com/Article/ArticleID/15153/15153.html ) and " I am unable to stop a process from Task Manager even though I'm an Administrator, what can I do?" ( http://www.windowsitpro.com/Article/ArticleID/14613/14613.html ), I explain how to submit a command by using the scheduler service with the /interactive switch to start a program. Because the scheduler service runs as the local system, the program would also run with local system credentials. With Winternals' Psexec utility (which you can download at http://www.sysinternals.com/Utilities/PsExec.html), 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:

whoami
SAVILLTECH\john

psexec -s cmd.exe

PsExec v1.60 - Execute processes remotely
Copyright (C) 2001-2005 Mark Russinovich
Sysinternals - www.sysinternals.com


Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\WINDOWS\system32>whoami
NT AUTHORITY\SYSTEM

C:\WINDOWS\system32>exit
cmd.exe exited on WKSSAVD800 with error code 0.

When you use the -s switch, Psexec temporarily installs on the computer a service named "psexec running psexesvc.exe" which is removed after the application running as system is closed. Thus to run under the system context, you'll need permissions to install services.

Related Content:

ARTICLE TOOLS

Comments
  • dumitrurobert
    5 months ago
    Sep 24, 2011

    Another way would be using AT command (task scheduler console):

    at 12:39 /interactive program.exe (eg cmd.exe), assuming that now is 12:37 PM...

    Does work on XP and perhaps 2k.

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.