cpremo Posted January 31, 2009 Posted January 31, 2009 I've created a script as shown but it doesn't work. What's wrong???? The application starts installing but when it gets to installing files in the "C:\Windows\system32" directory it fails stating "Error 1321.The installer has insufficient privileges to modify the file C:\Windows\system32\gwenv1.dll" Script *************************************************************************************** ; Fill in the username and password appropriate for your system. Local $sUserName = "administrator" Local $sPassword = "password" Dim $Filename = IniRead ( @ScriptDir & "\SciTE.ini", "CommandData", "EXEFile", "default" ) $Domain = @ComputerName If Not IsAdmin() Then ; Run a command prompt as the other user. Local $pid = RunAs($sUserName, $Domain, $sPassword, 4, RunWait($Filename), @ScriptDir) ; Wait for the process to close. ProcessWaitClose($pid) Else Run($Filename, @ScriptDir, @SW_HIDE) EndIf *************************************************************************************** SciTE.ini *************************************************************************************** [CommandData] EXEFile="W:\Novell - GroupWise Client\client 7.0.3\win32\setup.exe" [LogoData] Destination1="C:\Windows\" Destination2=C:\WINNT\****************************************************************************************
dgarrett8 Posted January 31, 2009 Posted January 31, 2009 You have vista? "I think, therefore I am"[size="1"]René Descartes[/size]
isolation Posted January 31, 2009 Posted January 31, 2009 Local $sUserName = "administrator" Local $sPassword = "password" Dim $Filename = IniRead ( @ScriptDir & "\SciTE.ini", "CommandData", "EXEFile", "default" ) $Domain = @ComputerName If Not IsAdmin() Then $pid = RunAsWait($sUserName, $Domain, $sPassword, 4, $Filename) Else $pid = Run($Filename, @ScriptDir, @SW_HIDE) EndIf well... I'm a newbie but...try...
cpremo Posted February 2, 2009 Author Posted February 2, 2009 You have vista?No, all my PCs are WinXP.
cpremo Posted February 4, 2009 Author Posted February 4, 2009 DOESN'T ANY BODY RUN A SCRIPT INVOKING ADMIN PRIVILEGES?????
LarryDalooza Posted February 4, 2009 Posted February 4, 2009 (edited) I use something like this to "rerun" my script as an interactive admin. I have never had problems, unless!!!, my credentials are not a "local admin". Your credentials must be local admin. If Not IsAdmin() Then If $CMDLINE[0] = 0 Or $CMDLINE[1] <> "ReRun" Then If Not RunAs("admin","MyDomain","password",1,"""" & @ScriptFullPath & """ ReRun",@ScriptDir) Then Exit 1 Exit 0 Else MsgBox(4096,"ReRun","ReRun failed.") Exit 1 EndIf EndIf MsgBox(4096,"","I am an Admin") make some short tests for yourself before bothering us too much. Chances are it's entirely your mistake. Lar. Edited February 4, 2009 by LarryDalooza AutoIt has helped make me wealthy
cpremo Posted February 9, 2009 Author Posted February 9, 2009 I use something like this to "rerun" my script as an interactive admin. I have never had problems, unless!!!, my credentials are not a "local admin". Your credentials must be local admin. If Not IsAdmin() Then If $CMDLINE[0] = 0 Or $CMDLINE[1] <> "ReRun" Then If Not RunAs("admin","MyDomain","password",1,"""" & @ScriptFullPath & """ ReRun",@ScriptDir) Then Exit 1 Exit 0 Else MsgBox(4096,"ReRun","ReRun failed.") Exit 1 EndIf EndIf MsgBox(4096,"","I am an Admin") make some short tests for yourself before bothering us too much. Chances are it's entirely your mistake. Lar. Sorry if I'm a little dense, but . . . What do the $CMDLINE value refer to. It's not part of my code, so it must be something in your complete coded script. Either way, it fails to do anything on my test PC. And yes, we don't have a Windows Domain and are trying to use Local admin credentials. We are a Novell shop and use local accounts to authenticate to the PCs as well as loging into to our Novell domain.
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