I'm trying to run xcopy commands in a batch file as an administrator. Is this the correct command and how can I pass the password into it?
runas /noprofile /user:Domain Name\user account
|
I'm trying to run
|
||||
|
|
|
To automatically authenticate add the Realize that Your usage is correct though, just add the program path at the end.
To delete a saved credential search for the Credential Manager in Control Panel. |
|||
|
|
|
The You may right click on the executable and click If you wanted to run the task as a scheduled task, you can set it to run it as different user there. |
|||||||
|
|
You could use RunAs when you call the batchfile (right click on the batchfile and click runas) to have the batch run as administrator. I suspect that runas will not work inside the batch. I'd recommend NOT putting the password in the batch file, even if it did work, batch files are plain text, so you might as well put the password on a post-it note on the monitor. |
|||
|
|
|
This website discusses creating an autoit script that obfuscates the the contents of the file towards the bottom of the file. http://www.neowin.net/forum/topic/922704-secure-use-of-passwords-in-batch-files/ |
|||
|
|