Jump to content
Posted 08 August 2008 - 19:04
Posted 08 August 2008 - 19:10
I know it isn't secure, but it is the best thing I have right now, so, here it goes...
I need to be able to run a file as an admin in a batch file (i.e. runas /u:Administrator "%blahblah%.exe").
The runas command built into Windows doesn't support this, but I know I've seen apps that do support this. Anyone know of any that are free?
Remember, the entire thing is command line. Thanks for the help
Posted 08 August 2008 - 19:12
Posted 08 August 2008 - 20:24
Posted 08 August 2008 - 20:41
Posted 10 August 2008 - 12:25
Posted 10 August 2008 - 12:35
Posted 11 August 2008 - 13:38
^ the problem is that is with /savecred they can run "anything" they want with those credentials.
Posted 11 August 2008 - 14:19
Or use the solution where it isn't. Like mine.
But if the other option is to have the password in plaintext in the batch file, this isn't really an issue?
Posted 11 August 2008 - 18:54
Posted 12 August 2008 - 18:33
But there were many options give than allow you to encode/encrypt the password so that its not plain text, or you could turn the batch into an exe so they can not clearly read the password, etc.
But if the other option is to have the password in plaintext in the batch file
Posted 14 August 2008 - 05:23
; Are we already admin? If Not IsAdmin() Then RunAsSet($CmdLine,'' , $CmdLine) Run( $CmdLine ) Exit EndIfSave this script as BatchRunAs.au3 (or whatever) and compile it to an executable with Aut2Exe. Then in the batch file just add the line
BatchRunAs.exe <Username> <Password> CommandIf required the username, password and the program to be run can all be hard coded (change the CmdLine parameters in the above script), before converting to an exe.