Skip to main content
The 2024 Developer Survey results are live! See the results

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • I believe 'runas' is a shell command. I need the command to be 'myexe.exe' followed by some argument which would make it run under different credentials. Any other hints ?
    – kellogs
    Commented Jan 13, 2011 at 20:20
  • 1
    Any modifier that comes after the command has to be built into the program. An example is iexplore.exe /k This opens Internet Explorer in kiosk mode and is built into the executable. Unless you write a script which executes the shell command with the program if you pass a modifier to the script like myscript.bat that runs myfile.exe normally but myscript.bat /another that runs myfile.exe through the shell command as another user. Commented Jan 13, 2011 at 20:25
  • You are right. no way around it I guess. Thank you
    – kellogs
    Commented Jan 13, 2011 at 20:26
  • very silly @kellogs obviously you cannot say there is no way around it. In fact there most definitely is a way around it. I once ran a script that did runas and wrote a password, and there is a program that will run a cmd shell hidden. So it is possible in theory, as a combined solution. The program that runs things hidden is HSTART ntwind.com/software/hstart.html
    – barlop
    Commented Feb 11, 2013 at 12:14