Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have written a simple bat file to run a silverlight install at login.

I have the script called via GPO and AD, but when it runs, i have the issue of admin rights and UAC.

Is there a way to stream the admin username and password into the script so it will install??


set DeployServer=\\installs\Silverlight\

set InstallerName=Silverlight.exe /q

Set LogLocation=\\installs\SilverlightLogs

REM ********************************************************************* REM Deployment code begins here. Do not modify anything below this line. REM

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Silverlight if %errorlevel%==1 (goto DeploySilverlight) else (goto End)

REM If 1 returned, the product was not found. Run setup here. :DeploySilverlight start /wait %DeployServer%\%InstallerName% echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt

REM If 0 or other was returned, the product was found or another error occurred. Do nothing. :End


This is what i have so far.

share|improve this question
i have local admin rights across the domain, but need to export the bat to other users as a logon script. I have tried using the runas command and piping in the password but only get errors. Thanks F – Fulcanelli Dec 21 '09 at 13:01
I don't know much GPO, but I think you are probably doing it the wrong way. The GPO that triggers the install should apply to the machine instead of to a user. Microsoft has other way of deploying software unattended than what you are trying to achieve. – dolmen Mar 27 '11 at 11:24
up vote 0 down vote accepted

Native runas cannot be passed a password, you'd have to use a 3rd party app. The following is free, the full version allows you to encrypt the password:

Then you could call the batchfile from within another batchfile containing the following:

runas password yourbatchfile.bat

That's about the best solution I can come up with for you ...

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .