I need to determine OS and disable firewall accordingly. Windows xp works, however HNetCFg.FwMgr does not work on Vista or 7 - oh and GPO is not an option - any help much appreciated. (ignore msgbox as i was simply testing)
Set objWshShell = WScript.CreateObject("WScript.Shell")
strOSVersion = objWshShell.RegRead("HKLM\Software\Microsoft\Windows NT\CurrentVersion\CurrentVersion")
If strOSVersion = "5.1" Then
Debug.WriteLine("Windows XP")
Set objFirewall = CreateObject("HNetCfg.FwMgr")
Set objPolicy = objFirewall.LocalPolicy.CurrentProfile
objPolicy.FirewallEnabled = FALSE
ElseIf strOSVersion = "6.0" Then
Debug.WriteLine("Windows Vista")
Msgbox ("Hi Iam Tiger Woods")
ElseIf strOSVersion = "6.1" Then
Debug.WriteLine("Windows 7")
Msgbox ("Hi I am Tiger Woods")
End If