obfuscatedv Posted March 17, 2015 Share Posted March 17, 2015 Been stuck for several hours trying to uninstall a kb. From the command prompt, it works fine: cd c: then, C:WindowsSystem32wusa.exe /uninstall /kb:xxxxxxx /quiet /norestart Wusa does its thing, finds the kb, after the wusa process is done restart the pc, and its gone. For the autoit scripts Ive tried: ShellExecute("wusa.exe" & '/uninstall /kb:xxxxxxx /quiet /norestart') No luck ^ $wusa = @WindowsDir & "\System32\wusa.exe" Run($wusa & " /uninstall /kb:xxxxxxx /quiet /norestart") No luck ^ $cmd = "wusa.exe /uninstall /kb:xxxxxxx /quiet /norestart" RunWait(@ComSpec & " /c " & $cmd, @WindowsDir & "\System32", @SW_HIDE) No luck ^ ;FileCopy(@ScriptDir & '\kbuninstall.cmd', "C:\Temp") ;Sleep(5000) ;RunWait('C:\Temp\kbuninstall.cmd', '', @sw_hide) ^ Even tried running both .cmd and .bat files locally $x = RunWait(@ComSpec & " /c C:\Windows\System32\wusa.exe /uninstall /kb:xxxxxxx /quiet /norestart", @SystemDir, @SW_HIDE) MsgBox(0, "", $x) No luck on this either, although it does bomb out with error code -2147418113 which appears to be a "catastrophic failure," (lol) similar to this link: https://social.technet.microsoft.com/Forums/systemcenter/en-US/a218e294-b0e6-4b26-80a9-4eef72476fff/wusaexe-uninstall-and-sccm?forum=configmgrsum Searched up and down, never seen anything like it. Link to comment Share on other sites More sharing options...
jguinch Posted March 17, 2015 Share Posted March 17, 2015 (edited) If your OS is a 64 bits, you can try to use the native x64 system32 directory by using @WindowsDir & "sysnative" : $wusa = @WindowsDir & "\SystemNative\wusa.exe" Run($wusa & " /uninstall /kb:xxxxxxx /quiet /norestart") Not really sure .. Edited March 17, 2015 by jguinch Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
obfuscatedv Posted March 18, 2015 Author Share Posted March 18, 2015 Unfortunately that does not work either. Link to comment Share on other sites More sharing options...
Kyan Posted March 18, 2015 Share Posted March 18, 2015 I think you need #RequireAdmin on top of your script Heroes, there is no such thing One day I'll discover what IE.au3 has of special for so many users using it.C'mon there's InetRead and WinHTTP, way better Link to comment Share on other sites More sharing options...
obfuscatedv Posted March 18, 2015 Author Share Posted March 18, 2015 I do have #RequireAdmin at the top, sorry for not mentioning! Link to comment Share on other sites More sharing options...
Solution Tripredacus Posted March 18, 2015 Solution Share Posted March 18, 2015 If your OS is a 64 bits, you can try to use the native x64 system32 directory by using @WindowsDir & "sysnative" :This specific issue relates to running a .cmd/bat through ComSpec with a 32bit compiled .EXE on 64bit OS. In this case, Windows will use the cmd.exe in Syswow.@OP try compile your AutoIT.exe in x64 architecture if you are using Windows x64. obfuscatedv 1 Twitter | MSFN | VGCollect Link to comment Share on other sites More sharing options...
obfuscatedv Posted March 18, 2015 Author Share Posted March 18, 2015 This specific issue relates to running a .cmd/bat through ComSpec with a 32bit compiled .EXE on 64bit OS. In this case, Windows will use the cmd.exe in Syswow. @OP try compile your AutoIT.exe in x64 architecture if you are using Windows x64. Fantastic, that did it. I did not even think about that. You rock! Thanks! Link to comment Share on other sites More sharing options...
iamtheky Posted March 18, 2015 Share Posted March 18, 2015 then just disabling redirection should work as well? DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1) Kyan 1 ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
obfuscatedv Posted March 18, 2015 Author Share Posted March 18, 2015 I am trying that out just for fun to see if it does. Link to comment Share on other sites More sharing options...
Caiaphas Posted August 14, 2015 Share Posted August 14, 2015 Simple Fix try to add to your script one little line to that is missing.#RequireAdmin ;~ this is whats missing UAC is not allowing the command to run. ShellExecute("wusa.exe" & '/uninstall /kb:xxxxxxx /quiet /norestart')UAC is blocking you, this is why its not working. I hope this works... let me know ... 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