So I know, that I could just create a shortcut with RunAs but I was wondering, whether it would be possible to pass the password already as a parameter to the script, so I do not have to type it in all the time.
Any advise?
Thanks!
So I know, that I could just create a shortcut with RunAs but I was wondering, whether it would be possible to pass the password already as a parameter to the script, so I do not have to type it in all the time.
Any advise?
Thanks!
Rather than putting the password in the batch file you can use the /savecred switch to get it to save your password for you after you enter it.
It will mean that you can always run any program as that user in future, but it is slightly more secure than leaving your password in plaintext in a batch file.
runas cannot be supplied a password, it was specifically written to forbid accepting a password on the command line for security reasons.
An alternative program might be cpau which will accept a password.