Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

My customers don't want to do a SHIFT+Right Click > "Run as" on a script.

So I am looking for a way to do exactly the same from a batch script.

How to open this window on Windows XP from a batch script?

Run as windows XP

The user needs to launch the program as another local user.


I found a solution for Windows 7 here but it doesnt' work on XP...

share|improve this question
ShellRunas could be a solution but I am astonished this feature doesn't exist on XP... – Maxbester Jun 7 '13 at 12:28


On Error Resume Next

strComputer = "." 'local computer
strUserName = "Domain\User" 'user name
strPassword = "Password" 'user password


Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objServices = objSWbemLocator.ConnectServer(strComputer, "root\CIMV2", strUserName, strPassword, Null, Null, 0)

If Err.Number <> 0 Then
    WScript.Echo Err.Number & ": " & Err.Description
End If

Set objClass = objServices.Get("Win32_Process")
Res = objClass.Create(strCommandLine, Null, Null, PID)
If Res <> 0 Then
    WScript.Echo "Error ru application code: " & Res
End If

Encode a Script

GreyMagic Online Script Decoder

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.