Remove WGA Notifications with AutoIT

Remove or uninstall Windows Genuine Advantage Validation Tool. This is possible by reviewing the contents of the update.inf file that is part of the WindowsXP-KB905474-ENU-x86-Standalone.exe. Microsoft offers a manual method in their knowledge base (KB921914). Once the WGA Validation tool is installed, there is no usable add/remove entry to remove.

Here is an AutoIT script to automate the manual removal:

; RemoveWGA Notifications v1.0
; This is a response to the Microsoft update WindowsXP-KB905474-ENU-x86-Standalone.exe
; which fails to include a functional uninstallation process.  The following work Is
; derived through the update.inf file that is extracted to install.

#NoTrayIcon

;UnRegister LegitCheckControl.dll
RegDelete ("HKEY_CLASSES_ROOT\AppID\{2DE6426A-0708-415C-8C19-623CC4855F80}")
RegDelete ("HKEY_CLASSES_ROOT\AppID\LegitCheckControl.DLL")
RegDelete ("HKEY_CLASSES_ROOT\LegitCheckControl.LegitCheck")
RegDelete ("HKEY_CLASSES_ROOT\LegitCheckControl.LegitCheck.1")
RegDelete ("HKEY_CLASSES_ROOT\CLSID\{17492023-C23A-453E-A040-C7C580BBF700}")
RegDelete ("HKEY_CLASSES_ROOT\TypeLib\{5E649A63-7EE9-43F4-9926-0DEAA462A8FB}")
RegDelete ("HKEY_CLASSES_ROOT\Interface\{36CFF953-FB06-45AD-896F-94A0259AB3DD}")
;Un-Hook WgaLogon.dll
RegDelete ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\WgaLogon")
;Remove ARP entry
RegDelete ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WgaNotify")

;Process To Run Before Uninstall
If FileExists("C:\WINDOWS\system32\WgaTray.exe") Then
Run(@ComSpec & " /c WgaTray.exe /u", @SystemDir, @SW_HIDE)
Run(@ComSpec & " /c spupdsvc.exe /install", @SystemDir, @SW_HIDE)
EndIf

;Add Registry Keys to perform post-uninstall tasks
If FileExists("C:\WINDOWS\system32\WgaLogon.dll") Then
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "RemoveWGA1", "REG_SZ", "C:\WINDOWS\system32\cmd.exe /c del /q C:\WINDOWS\system32\WgaLogon.dll")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "RemoveWGA2", "REG_SZ", "C:\WINDOWS\system32\cmd.exe /c del /q C:\WINDOWS\system32\WgaTray.exe")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "RemoveWGA3", "REG_SZ", "C:\WINDOWS\system32\cmd.exe /c del /q C:\WINDOWS\system32\dllcache\WgaLogon.dll")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "RemoveWGA4", "REG_SZ", "C:\WINDOWS\system32\cmd.exe /c del /q C:\WINDOWS\system32\dllcache\WgaTray.exe")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "RemoveWGA5", "REG_SZ", "C:\WINDOWS\system32\cmd.exe /c del /q C:\WINDOWS\system32\LegitCheckControl.dll")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "RemoveWGA6", "REG_SZ", "C:\WINDOWS\system32\cmd.exe /c C:\WINDOWS\system32\spupdsvc.exe /delete")

ProcessWaitClose("cmd.exe")

;Reboot Required
Shutdown (2)

Else
;do nothing
EndIf