shornw Posted April 23, 2013 Share Posted April 23, 2013 Can someone tell me what is wrong with this. I have little hair left and am in danger of tearing the it out. It all goes absolutely OK, but I get "Installer encountered an error: 0x8000ffff. Catastrophic failure". If I run the same text manually in a command prompt (I outputted it to a Notepad session to ensure the syntax was correct) it works just fine. The IPConfig (for test purposes) works no problem expandcollapse popup#include <Array.au3> #include <File.au3> #include <Array.au3> $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $Output="" Dim $aInstalledList[1], $aPatch[1], $quit, $Result $PatchList = FileOpenDialog("Select patch list text file", @ScriptDir, "(*.txt)") If @error = 1 Then $quit = MsgBox(20, "ERROR", "No file was selected. Do you want to quit?") If $quit = 6 Then Exit Else _FileReadToArray($PatchList, $aPatch) EndIf $objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\cimv2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_QuickFixEngineering", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems _ArrayAdd($aInstalledList, $objItem.HotFixID) Next EndIf _ArrayDisplay($aInstalledList) For $i = 1 to UBound($aPatch) -1 $Search = StringSplit($aPatch[$i], ":") ToolTip("Processing " & $aPatch, 0, 40) $Search = $Search[1] & $Search[2] $Result = _ArraySearch($aInstalledList, $Search) If $Result = -1 Then ContinueLoop Else RunWait(@ComSpec & ' /k wusa /uninstall /' & $aPatch[$i] & ' /NoReStart') ;RunWait(@ComSpec & ' /k ipconfig') EndIf Next [font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font] Link to comment Share on other sites More sharing options...
Tripredacus Posted April 23, 2013 Share Posted April 23, 2013 Why do you include Array twice? (I don't think its a problem)... I think maybe the value in $aPatch[$i] ends up not what you think... Try to MsgBox that out instead of your runwait (for test) to make sure it has the data you are expecting. Twitter | MSFN | VGCollect Link to comment Share on other sites More sharing options...
shornw Posted April 23, 2013 Author Share Posted April 23, 2013 Include Array was a copy/paste error. I have output to a Notepad session, then copied the text and pasted into a cmd prompt and it worked fine [font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font] Link to comment Share on other sites More sharing options...
JFX Posted April 23, 2013 Share Posted April 23, 2013 (edited) Change the line to that: ShellExecuteWait('wusa', '/uninstall /' & $aPatch[$i] & ' /NoReStart') Edit: Does it makes a difference if you compile as x64? Edited April 23, 2013 by JFX Link to comment Share on other sites More sharing options...
shornw Posted April 23, 2013 Author Share Posted April 23, 2013 Hmmm - Still no joy. Exactly the same errorIt makes no difference whether it's compiled x86, x64 or uncompiledc:\ [font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font] Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 23, 2013 Moderators Share Posted April 23, 2013 (edited) What happens if you remove Comspec from the equation and just do a shellexecute? ShellExecute("wusa.exe", '/uninstall /' & $aPatch[$i] & ' /NoRestart') Might be easier to debug depending on return from ShellExecute Edited April 23, 2013 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
shornw Posted April 24, 2013 Author Share Posted April 24, 2013 As stated above, I get exactly the same error. This is REALLY frustrating as I know the syntax is correct - if I run the command manually, it works fine. Any ideas on how to debug this would be much appreciated. As far as the script is concerned, the command completes successfully (either RunWait, ShellExecute or ShellExecuteWait, it fails after the command is launched. [font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font] Link to comment Share on other sites More sharing options...
whim Posted April 24, 2013 Share Posted April 24, 2013 I'm under the impression that AutoIt's default path searching works slightly different than the one employed by cmd. I've taken to always specifying full paths wherever a file argument is required, and haven't run into this since. Not checked with your code(s) though, YMMV wim Link to comment Share on other sites More sharing options...
shornw Posted April 24, 2013 Author Share Posted April 24, 2013 there doesn't seem to be an issue with the path. To test this, I deliberately entered an incorrect parameter (/NoReboot instead of /NoRestart) which invoked the WUSA info page. Therefore the WUSA element IS being run [font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font] Link to comment Share on other sites More sharing options...
Tripredacus Posted April 24, 2013 Share Posted April 24, 2013 Try to fully qualify your path to wusa.exe? For 32bit OS: C:\Windows\System32\wusa.exe For 64bit OS: c:windowssysnativewusa.exe Twitter | MSFN | VGCollect 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