Trying to install a piece of software from a network location, and everything works great except the software requires admin rights to install.

Is there a way I can pre enter an admin service account that will allow this to install? Without the user needing to provide the details?

Alternately, is there a way I can give the batch file Admin rights thus passing them off to the Installer file?

link|improve this question

50% accept rate
feedback

1 Answer

up vote 2 down vote accepted

The best way I have found to do this is to create a small AutoIT executable that does a run as, eg:

$User="User"
$Pass="Pass"
$Domain="Domain"
$Executable="\\your\path\here.exe"
RunAs($User,$Domain,$Pass, 1, $Executable, @SystemDir )

You will want to use a temporary account for this purpose as it is theoretically possible to reverse engineer out the ID and password encoded in the EXE file.

EDIT - the $Executable path listed above should be the path to your batch file.

link|improve this answer
Do both batch files need to be converted to EXE? the Run as and the actual script? When I try running the code you provided, it simply scrolls through the output line over and over indefinitely. – level42 Oct 19 '11 at 18:38
\\dcifs04\gpofiles>$User="user" '$User' is not recognized as an internal or external command, operable program or batch file. – level42 Oct 19 '11 at 18:55
Disregard, I figured it out. Thanks! – level42 Oct 19 '11 at 19:06
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.