Inforcer25

Easy Firewall manage

Dec 28th, 2015
509
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2. Title Easy Firewall
  3. cls
  4. :menu
  5. echo.
  6. echo Please note that Easy Firewall only opens it in your firewall and not your
  7. echo. router!
  8. echo.
  9. echo --------------------------------------------------------------------------------
  10. echo                           Easy Firewall by Inforcer25
  11. echo --------------------------------------------------------------------------------
  12. echo.
  13. echo.
  14. echo.
  15. echo.
  16. echo.
  17. echo Select a Option
  18. echo ================
  19. echo.
  20. echo [1] Open Port (TCP)
  21. echo [2] Open Port (UDP)
  22. echo [3] Allow program (BETA!)
  23. echo [4] Exit
  24. echo.
  25. set /p op=Option:
  26. if %op%==1 goto open_tcp
  27. if %op%==2 goto open_udp
  28. if %op%==3 goto allow_program
  29. if %op%==4 goto exit
  30. goto error
  31.  
  32. rem =================================================================================================
  33.  
  34. :open_tcp
  35. cls
  36. @echo off
  37. echo.
  38. echo "Please enter port"
  39. set /p tcp_port=Port:
  40. echo.
  41. echo "Please enter name of rule"
  42. set /p tcp_rule=Name:
  43. echo.
  44. netsh firewall add portopening tcp %tcp_port% "%tcp_rule%" >nul
  45. ping localhost -n 5 >nul
  46. cls
  47. echo.
  48. echo.
  49. echo.
  50. echo The port is now open!
  51. echo.
  52. echo Press Enter to go to the menu.
  53. pause >nul
  54. goto menu
  55.  
  56. rem =================================================================================================
  57.  
  58. :open_udp
  59. cls
  60. @echo off
  61. echo.
  62. echo "Please enter port"
  63. set /p udp_port=Port:
  64. echo.
  65. echo "Please enter name of rule"
  66. set /p udp_rule=Name:
  67. echo.
  68. netsh firewall add portopening udp %udp_port% "%udp_rule%" >nul
  69. ping localhost -n 5 >nul
  70. cls
  71. echo.
  72. echo.
  73. echo.
  74. echo The port is now open!
  75. echo.
  76. echo Press Enter to go to the menu.
  77. pause >nul
  78. goto menu
  79.  
  80. rem =================================================================================================
  81.  
  82. :allow_program
  83. cls
  84. @echo off
  85. echo.
  86. echo Please not that this option is in beta!
  87. echo.
  88. echo (Program path Eg. "C:\program files\Skype.exe")
  89. echo.
  90. echo "Enter Program Path" (Don't add qoutes)
  91. set /p pro_path=Program Path:
  92. echo.
  93. netsh firewall add allowedprogram "%pro_path%" cobain enable >nul
  94. ping localhost -n 5 >nul
  95. cls
  96. echo.
  97. echo.
  98. echo.
  99. echo The program is now allowed!
  100. echo.
  101. echo Press Enter to go to the menu.
  102. pause >nul
  103. goto menu
  104.  
  105. rem =================================================================================================
  106.  
  107. :error
  108. cls
  109. @echo off
  110. echo.
  111. echo.
  112. ECHO OOPS Wrong Option!
  113. ping localhost -n 5 >nul
  114. goto menu
  115.  
  116. rem =================================================================================================
  117.  
  118. :exit
  119. exit
  120.  
  121. rem =================================================================================================
RAW Paste Data