Skip to content

Instantly share code, notes, and snippets.

@Ruzzz
Created February 2, 2016 13:09
Show Gist options
  • Save Ruzzz/9565b772b4aafe84be01 to your computer and use it in GitHub Desktop.
Save Ruzzz/9565b772b4aafe84be01 to your computer and use it in GitHub Desktop.
set APP_NAME=Opera 12 for Safe Browsing
set APP_PATH=%UserProfile%\AppData\LocalLow\Opera 12 for Safe Browsing\opera.exe
set PORT=11011
netsh advfirewall firewall add rule name="%APP_NAME% (TCP-Out) Block All" dir=out action=block program="%APP_PATH%" protocol=tcp
netsh advfirewall firewall add rule name="%APP_NAME% (UDP-Out) Block All" dir=out action=block program="%APP_PATH%" protocol=udp
netsh advfirewall firewall add rule name="%APP_NAME% (TCP-Out)" dir=out action=allow program="%APP_PATH%" remoteip=127.0.0.1 remoteport=%PORT% protocol=tcp
netsh advfirewall firewall add rule name="%APP_NAME% (UDP-Out)" dir=out action=allow program="%APP_PATH%" remoteip=127.0.0.1 remoteport=%PORT% protocol=udp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment