Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to start win firewall from command line/batch file?

Status
Not open for further replies.

qwert85103

Technical User
Dec 27, 2003
162
0
0
US
hello,

how does one start win xp firewall through command line and set it to "ON"?

thanks.
 
Windows Firewall Netsh Helper was added to Windows XP in the Microsoft Advanced Networking Pack. This command-line helper previously applied to IPv6 Windows Firewall. With Windows XP Service Pack 2, the helper now includes support for configuring IPv4.

With Netsh Helper, you can now:
Configure the default state of Windows Firewall. (Options include Off, On, and On with no exceptions.)
Configure the ports that must be open.
Configure the ports to enable global access or to restrict access to the local subnet.
Set ports to be open on all interfaces or only on a specific interface.
Configure the logging options.
Configure the Internet Control Message Protocol (ICMP) handling options.
Add or remove programs from the exceptions list.
 
can anyone point me in the right direction to find examples of using command utilities that can be used in scripts on a domain to manipulate the firewall settings.. I guess it is done using netsh some how. I've looked at several microsoft pages but havnt found any specific examples of how to accomplish this, although several posts have referred to such things..

thanks for any information...
 
Make use of the netsh command and the /? switch and burrow down and the examples of usage will be shown.

netsh firewall /?

Commands in this context:
? - Displays a list of commands.
add - Adds firewall configuration.
delete - Deletes firewall configuration.
dump - Displays a configuration script
help - Displays a list of commands.
reset - Resets firewall configuration t
set - Sets firewall configuration.
show - Shows firewall configuration.




netsh firewall set /?

Commands in this context:
set allowedprogram - Sets firewall allowed program conf
set icmpsetting - Sets firewall ICMP configuration.
set logging - Sets firewall logging configuration.
set multicastbroadcastresponse - Sets firewall multicas
iguration.
set notifications - Sets firewall notification configuration
set opmode - Sets firewall operational configuration
set portopening - Sets firewall port configuration.
set service - Sets firewall service configuration.


netsh firewall set allowedprogram /?



Examples:

set allowedprogram C:\MyApp\MyApp.exe MyApp ENABLE

set allowedprogram C:\MyApp\MyApp.exe MyApp DISABLE

And more and more.....
 
the parts that are causing me problems are things like getting to the admin shares of the machines.. for example, Norton Antivirus server uses the admin$ share to push out updates and when the machines go on line with SP2, then my antivirus cant update the machines... and with a couple hundred machines I cant run out around configuring individual machines...

thanks for the information, Ill take a look the allowedprogram stuff.. for some other problems though.. that might work...
 
apply a logon or startup script to the site, something along the lines of:

net stop "windows firewall/internet connection sharing (ICS)"

this way the firewall is disabled whilst the user is logged in at your site that should be secure, however when at home the firewall will still run.

jrb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top