Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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.

share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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