MiniRunAs - A minimalist "run as" for Windows
MiniRunAs is used to run a program with a different Windows user.
It is an alternative to the Windows runas command.
- Open source.
- The password is specified as a parameter on the command-line.
- No additional console output is written during normal execution.
- No quotes are needed to specify the command-line of the program to be run.
So there is no need to escape quote characters in the command-line
and a backslash character at the end of the line is not a problem (which
would otherwise escape the closing quote).
- Calls the CreateProcessWithLogonW Win32 API function,
which uses the "Secondary Logon" Windows service to start a program in
a different security context.
- Written in C++.
Small and (relatively) simple source code.
May be compiled by Microsoft Visual C++ Express.
miniRunAs <user> <password> <commandline>
miniRunAs administrator sesame ping localhost
miniRunAs administrator sesame "%SystemRoot%\system32\cmd.exe" /T:4F
miniRunAs administrator sesame cmd.exe /c dir /p C:\
miniRunAs username@domain sesame notepad.exe
Author: Christian d'Heureuse