Jump to content

Cannot uninstall kb


Go to solution Solved by Tripredacus,

Recommended Posts

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

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 by jguinch
Link to comment
Share on other sites

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
happy.png

Link to comment
Share on other sites

  • Solution

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.

Link to comment
Share on other sites

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

then just disabling redirection should work as well?

DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

  • 4 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...