Hi guys,
I'm trying to use the below VBScript to read the state of the windows firewall, yet it's returning that the output is not in the correct <result>output</result> format... even though it seems to be...
Const FOR_READING = 1
const HKEY_LOCAL_MACHINE = &H80000002
const strKeyPath = "SYSTEMCurrentControlSetServicesSharedAccessParametersFirewallPolicyDomainProfile"
const strValueName = "EnableFirewall"
strComputer = "localhost"
On Error Resume Next
Set oReg=GetObject(
"winmgmts:{impersonationLevel=impersonate}!" &
strComputer & "
ootdefault:StdRegProv")
oReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
if dwValue <> 0 then
WScript.Echo "<result>" & "On" & "</result>" else
WScript.Echo "<result>" & "Off" & "</result>"
end if
However, this one that read the bigfix version works fine...
Dim verNum
Set objFSO = CreateObject("Scripting.FileSystemObject")
besClient = "C:Program FilesBigFix EnterpriseBES ClientBESClient.exe"
if objFSO.FileExists (besClient) then
verNum= objFSO.GetFileVersion (besClient)
WScript.Echo "<result>" & verNum & "</result>"
else
vernum= "Not Installed"
WScript.Echo "<result>" & verNum & "</result>"
end if
Any ideas?
Ben Toms
IT Support Analyst GREY Group
The Johnson Building, 77 Hatton Garden, London, EC1N 8JS
T: +44 (0) 20-3037-3819 |
Main: +44 (0) 20 3037 3000 | IT Helpdesk: +44 (0) 20 3037 3883
Grey Communications Group Limited
Registered No. 1795794, Registered in England
Registered Office The Johnson Building, 77 Hatton Garden, London, EC1N 8JS
VAT Number GB 404 6245 78