Child pages
  • How to get command prompt as the SYSTEM user
Skip to end of metadata
Go to start of metadata

For trouble-shooting purposes, it's often convenient to launch a Windows command prompt as the 'SYSTEM' user (This is the user account all Windows services run.)

  1. Open command prompt (keyboard: Windows key+R), and type "cmd.exe" to get a command prompt as you
  2. Execute at 12:34 /interactive "cmd.exe" (change 12:34 to one or two minutes ahead of the current time.)
  3. Wait for a few minutes
  4. You should see a new command prompt. That one runs as the system user.
  5. You can verify that by running "echo abc > x" and then run "dir /Q" to see that the newly created file is owned by administrators.

When all else fails and you still can't convince the SYSTEM user to do what you want, consider running Jenkins just as a start-up program on admin with auto-login normal user. This is much easier to set up. e.g.

sc config %jenkins_service_name% obj= %windows_domain%\%domain_user% password= %password%

Note, there is a space after equal signs, =

 

3 Comments

  1. This is not longer working on recent Windows versions.

    1. You see this:

      C:\Users\myuser>at 17:24 /interactive "cmd.exe"
      
      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.
      
  2. I now recommend using the psexec util for this - from sysinternals.

    psexec -i -s cmd.exe
    
Write a comment…