awaywilli Posted August 27, 2008 Share Posted August 27, 2008 We are trying to send out a package to field users who need to have a replacement application installed. When we run the compiled script as an admin it processes and installs fine. When we run it as a standard user it throws a message that we need admin rights to install the app for all users. Then the processing dies and nothing is installed.We have the following au3 script which we compiled into a .exe file:{CODE}; Declare variablesLocal $sUserName = "Encrypted UserAccount"Local $sDomain = "Encrypted @DOMAIN"Local $sPassword = "Encrypted PASSWORD"Local $iLogonFlag = 1Local $sInstallFile = "dfs path to install file"Local $sCopySessions = "dfs path to sessions file"; Run the installation as a user with Admin rights.RunAsWait ($sUserName, $sDomain, $sPassword, $iLogonFlag, Run($sInstallFile))Run($sCopySessions){END CODE}By all rights what we have above should work. Any rewrites, help or advice would be greatly appreciated.Thanks! Link to comment Share on other sites More sharing options...
Airwolf Posted August 27, 2008 Share Posted August 27, 2008 You shouldn't have a Run() function inside of RunAsWait()... Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt Link to comment Share on other sites More sharing options...
Distrophy Posted August 28, 2008 Share Posted August 28, 2008 (edited) If Not IsAdmin() Then RunAs($encryptuser, "***DOMAIN***", $encryptpass, 0, @ScriptName, @ScriptDir);rerun program with admin credentials Exit EndIf That will rerun your entire script as an admin. Edited August 28, 2008 by Distrophy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now