This answer has been taken from:- Library/Get Html.asp?ID=1199&Cat ID=295Full credit goes to the orginal [email protected]: No, it might not; I'm assuming the OP can "spot the pattern".This wasn't a plz-give-me-teh-codez answer :-S By the way, I should add the OP might want some more elaborate command like No, this answer is technically incorrect. - Shows this help -wait - Waits until prog terminates -k - Starts the the %COMSPEC% environment variable value and executes prog in it (CMD. EXE, etc.) prog - The program to execute args - Optional command line arguments to prog I think I have a solution to the password problem. It asks for the password once, and than never asks for it again.This is a question that comes up fairly often in our support forums, so I thought I would post a quick overview.The scenario is that an admin wants to package his script as an executable to allow regular users to accomplish some type of task, which requires full administrative privileges.If the last parameter is numeric, it is taken as a Long.If it can be parsed as a date, it is taken as a Date.
/savecred Use credentials previously saved by the user.
You might find this helpful for yourself, or run it from a batch file (although the password will be in clear text).
Another alternative is to hardcode the command, username and password in the script, then use the Script Encoder (download from to encode it.
If you are already running elevated, for example an elevated CMD shell, then RUNAS will launch an application as elevated, but this is equally true just running them without RUNAS, it makes no difference.
When a script is run with elevated permissions several aspects of the user environment will change: The current directory, the current TEMP folder and any mapped drives will be disconnected.