vergrugru Posted March 21, 2005 Share Posted March 21, 2005 HI,I new some Help qith this vb Script. Everytime a run this script I receive this windows :Internet Sharing Configuration C:\Windows\System32\WScript.exe is attempting to change or view this computer's Internet Conntection Protection settings. To give C:\Windows\System32\WScript.exe permission to edit these settings for as long as the program is opne, click YesSomeone knows how to run this script without this pop-up?Thanks Link to comment Share on other sites More sharing options...
IcemanND Posted March 21, 2005 Share Posted March 21, 2005 Why not just use the OEMFWALL tool from M$, it enables the firewall on all connections for SP1 machines.Otherwise you have to use something like AutoIT to click the OK button.see http://www.msfn.org/board/index.php?showtopic=9508&st=0 Link to comment Share on other sites More sharing options...
WotC Posted March 24, 2005 Share Posted March 24, 2005 Try this one:'http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ics/ics/wf_verify_wf_enabled.aspOption Explicit'Create Shell objectDim objShellset objShell = CreateObject("Shell.Application")'Declare Firewall variablesDim fwMgrDim profile'Verify that the SharedAccess service is running. If it isn't, then start it.If objShell.IsServiceRunning("SharedAccess") = FALSE Then objShell.ServiceStart "SharedAccess", TRUE 'Sleep 1 second to make sure the service is started ' before trying to create the objects below. If there ' is no sleep, then the script is too fast and the ' firewall objects can't be created. WScript.Sleep 1000End If'WScript.Echo("SharedAccess is running: " & objShell.IsServiceRunning("SharedAccess"))' Firewall objects have to be created after making sure' the service is running. If the service isn't running,' the script will fail.' Create the firewall manager object.Set fwMgr = CreateObject("HNetCfg.FwMgr")' Get the current profile for the local firewall policy.Set profile = fwMgr.LocalPolicy.CurrentProfile'Verify that the Firewall is enabled. If it isn't, then enable it.If profile.FirewallEnabled = FALSE Then profile.FirewallEnabled = TRUEEnd If'WScript.Echo("Firewall Enabled: " & profile.FirewallEnabled)'WScript.Echo("Firewall Exceptions Not Allowed: " & profile.ExceptionsNotAllowed) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now