#NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile=WMIRepair.exe #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Res_Comment=ThatGuy2223 #AutoIt3Wrapper_Res_Description=WMI Reinstall/Repair #AutoIt3Wrapper_Res_Fileversion=1.0.0.0 #AutoIt3Wrapper_Res_Language=1033 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include #Include ;ReadMe ;Windows XP/Windows XP X64 Only (This may work on Windows 2000, but it has not been tested.) ;This script reinstalls WMI. ;The I386/AMD64 folder must be present on C:\ or on a fixed disk/USB drive. ;If you run the inf from a differnt location other than I386/AMD64 folder, you will get missing files and the installation will fail. ;The only alternitive is to find every file in the wbemoc.inf and place them in the same folder as the inf. ;OSArch Check If @OSArch = "X86" Then ;X86 Section ;Checks For Windows X86 Installation Files If Not FileExists("C:\I386\") Then Exit EndIf ;Copies WMI Inf Installation File. FileCopy ( "C:\WINDOWS\inf\wbemoc.inf","C:\I386\wbemoc_reinstall_x86.inf") ;Adds [Components] Section To Inf For Sysocmgr. IniWriteSection ( "C:\I386\wbemoc_reinstall_x86.inf", "Components", "WBEM=ocgen.dll,OcEntry,wbemoc.inf,,7") ;Creates Sysocmgr Answer File. _FileCreate("C:\I386\I.txt") IniWriteSection ( "C:\I386\I.txt", "Components", "WMI = on") ;Starts Sysocmgr WMI Reinstall Silently.(Take out /q to see passive GUI.) _Rundos("sysocmgr /i:C:\I386\wbemoc_reinstall_x86.inf /u:C:\I386\I.txt /f /q") Else ;X64 Section ;Checks For Windows X64 Installation Files If Not FileExists("C:\AMD64\") Then Exit EndIf ;Copies WMI Inf Installation File. FileCopy ( "C:\WINDOWS\inf\wbemoc.inf","C:\AMD64\wbemoc_reinstall_x64.inf") ;Adds [Components] Section To Inf For Sysocmgr. IniWriteSection ( "C:\AMD64\wbemoc_reinstall_x64.inf", "Components", "WBEM=ocgen.dll,OcEntry,wbemoc.inf,,7") ;Creates Sysocmgr Answer File. _FileCreate("C:\AMD64\I.txt") IniWriteSection ( "C:\AMD64\I.txt", "Components", "WMI = on") ;Starts Sysocmgr WMI Reinstall Silently. (Take out /q to see passive GUI.) _Rundos("sysocmgr /i:C:\AMD64\wbemoc_reinstall_x64.inf /u:C:\AMD64\I.txt /f /q") Endif Exit