Excuse me for this - there's an issue with this code - it's from
I don't normally use VB i use PS and have tried various things editing line 7 of this code which is:
Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &strComputer & "\root\cimv2")
With no success. Can anyone help here? This might be quite easy for someone - this would help me use vb as a detection clause for older hardware which doesn't run the windows management framework/powershell.
'Returns if Windows KB2506143 installed
Option Explicit
Dim objWMI, strComputer
strComputer = "."
'Run the query
Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &strComputer & "\root\cimv2")
Dim listPatches
Dim patch
Set listPatches = objWMI.ExecQuery ("Select * from win32_QuickFixEngineering where HotFixID like 'KB960568'")
For Each patch in listPatches
Wscript.echo "Update installed"
Next
WScript.Quit
C:\Users\royston\AppData\Local\Adersoft\VbsEdit\Temp\BCAWFOZT.vbs(7, 76) Microsoft VBScript compilation error: Expected ')'
***** script completed - exit code: 1 *****
Thanks in advance.