18

How do I open an interactive application, such as cmd.exe or Windows Explorer, running as NETWORK SERVICE? There are ways to do it for the SYSTEM account, but NETWORK SERVICE is proving to be a challenge. I need this to work on Windows 7, but would be interested in solutions for other Windows versions as well.

EMP
  • 59,148
  • 53
  • 164
  • 220
  • I wish I could upvote this question & answer more times. psexec is my new favourite toy! – Rory Aug 08 '13 at 18:47

2 Answers2

22

Have you tried PsExec, a couple of interesting links with more information:

aseques
  • 537
  • 4
  • 21
swatkat
  • 4,785
  • 1
  • 23
  • 17
  • Wow, I totally didn't realise it would would work with the -u option with a "special" user (for which I don't know the password), but it did. It worked on Windows 7 x64 and Windows XP x86, though failed on Windows XP x64 as your linked post mentions. Still, it's good enough for my purposes. – EMP Nov 11 '10 at 22:10
  • 7
    One windows 2008 R2 psexec cmd launches a separate command prompt window. `psexec -u "nt authority\network service"` cmd.exe launches a command prompt in the same console window. Running a GUI program from that instance of cmd.exe or directly from `psexec -u "nt authority\network service"` will start the process, but not display it. I have UAC turned off. – Justin Dearing Jan 04 '12 at 16:16
  • 5
    Justin, add in a `-i` to your commandline, e.g. `psexec -i -u "nt authority\network service" cmd.exe ` – Rory Jul 31 '13 at 14:51
5

Here is how you would use PsExec to run cmd.exe under "NETWORK SERVICE" user context:

psexec -i -u "nt authority\network service" cmd.exe 
James Wierzba
  • 16,176
  • 14
  • 79
  • 120