Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a process that is running under the local system account on a Windows XP machine. This process then attempts to open a file with its default application as another user (say Max) on the system. Max is logged in and has a desktop.

The file is opened with the following command with ShellExecute in vbscript:

runas /user:Max "cmd.exe /C start \"path_to_file\""

After the process running under the local system account executed above, Max is prompted to enter his password. (So, the runas component clearly gets started at least.)

Only, even after entering the correct password, runas produces the following error:

RUNAS ERROR: Unable to run - cmd.exe /C start "path_to_file"
5: Access is denied.

I am not clear to what access is denied. Running cmd.exe /C start "path_to_file" as Max works perfectly fine. Max thus clearly has access to "path_to_file".

share|improve this question
up vote 1 down vote accepted

This appears to be the same problem as encountered with PSExec. Edit: Runas and PSExec spawn new processes with different credentials by calling CreateProcessWithLogonW. However if you are using the "LocalSystem" account:

You cannot call CreateProcessWithLogonW from a process that is running under the "LocalSystem" account, because the function uses the logon SID in the caller token, and the token for the "LocalSystem" account does not contain this SID.

share|improve this answer
Could you please post the answer in more detail here and not link to a web page? – Werner Henze Jun 7 '13 at 14:07

I made a similar experience when I tried with the sanur tool which automatically enters the password. My script work fine as long as I used my account. when I ran it in SCCM which works with the systen account it failed.

I found no way around, my conclusion is that you can't start runas with the system account.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .