There are a several utilities to run as a different user (eg: runas
, cpau
, psexec
) but all of them require the password for the respective user, even if you are already running with elevated privileges.
I'd like to achieve the following:
- I already have an elevated prompt (
Administrator
) - I'd like to execute a command (eg:
calc.exe
) asjohn
without typing/passing their password to the launcher utility.
For example, in Unix system you could just:
root@server:~# su - john
Best Answer
I use this all the time. It does take entering a credential the first time it's used (and when the password changes) but that's it.
If you save this command as part of a bat file you can create a shortcut that will launch this with administrative rights using a target like the following.