This batch file is about configure firewall.
1) XP Case
firewall.bat file
rem delete previous configuration to prevent duplicate2)
netsh firewall delete allowedprogram c:\myapp\myapp.exe
rem add myapp.exe to allow list.
netsh firewall add allowedprogram c:\myapp\myapp.exe Myapp-firewall enable
2) Windows 7 Case
REM *** Delete previous firewall config. ***
netsh advfirewall firewall delete rule name=MyAppfirewall
REM *** allow inbound ***
netsh advfirewall firewall add rule name="MyAppfirewall" dir=in protocol=tcp action=allow program="c:\MyApp\MyApp.exe"
netsh advfirewall firewall add rule name="MyAppfirewall" dir=in protocol=udp action=allow program="c:\MyApp\MyApp.exe"
REM *** allow inbound ***
netsh advfirewall firewall add rule name="MyAppfirewall" dir=out protocol=tcp action=allow program="c:\MyApp\MyApp.exe"
netsh advfirewall firewall add rule name="MyAppfirewall" dir=out protocol=udp action=allow program="c:\MyApp\MyApp.exe"