Advertisement
Shiny_

Untitled

Jun 2nd, 2017
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ECHO OFF
  2. set PORT=%1
  3. set RuleName="Block Port %PORT%"
  4.  
  5. netsh advfirewall firewall show rule name=%RuleName% >nul
  6. if not ERRORLEVEL 1 (
  7.     rem Rule Name %RuleName% już istnieje.
  8.     echo Podana nazwa Rule Name już istnieje. Nie możesz użyć drugi raz tej samej.
  9. ) else (
  10.     echo Rule Name: %RuleName% nie istnieje. Tworzenie nowej...
  11.     netsh advfirewall firewall add rule name=%RuleName% dir=in action=block protocol=TCP localport=%PORT%
  12. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement