1

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?

EEAA
  • 109,363
  • 18
  • 175
  • 245
level42
  • 199
  • 2
  • 11

1 Answers1

2

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.

Tim Brigham
  • 15,545
  • 10
  • 75
  • 115
  • 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