Is there any single line command for Run As Different User in Windows 7.
I am using following command but then it ask for password
runas /user:USER-NAME "C:\full\path\of\Program.exe"
Is there any way to supply password also
in above line ? Actually i am launching application from other application so I don't want any user interaction But in above command it ask user for PASSWORD
The runas command does not allow a password on its command line. This is by design (and also the reason you cannot pipe a password to it as input).
Use Run As to start a program as another userLocate the program that you want to start in Windows Explorer, the Microsoft Management Console (MMC), or Control Panel. Press and hold down the SHIFT key while you right-click the .exe file or icon for the program, and then click Run as. Click The following user.
PsExec in the MS SysInternals suite:
psexec -user Administrator -p Passwd "xcopy a.xml \\server_over_there\c$\A.xml"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With