add_firewall_exception.bat 348 B

12345678910111213
  1. @echo off
  2. net session >nul 2>&1
  3. if %errorLevel% == 0 (
  4. for %%x in (in out) do (
  5. netsh advfirewall firewall add rule action=allow profile=any protocol=any enable=yes direction=%%x name=ShinraMeter program = "%~dp0%ShinraMeter.exe" > NUL
  6. )
  7. echo Rule added to the firewall
  8. ) else (
  9. echo You must run this program in admin mode
  10. )
  11. pause >nul