Imthedude025

PORTFORWARD GUIDE (Batch)

Oct 4th, 2019
27
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2. ::Port-Forward Guide Via Batch ::
  3. ::Created by RU$$ [http://russdev.mooo.com/] ::
  4. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  5. @ECHO OFF
  6. @SETLOCAL
  7. @TITLE PORTFORWARD GUIDE
  8. call :initColorPrint
  9.  
  10. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  11. ::START Code
  12.  
  13. set ip=
  14. for /f "tokens=2,3 delims={,}" %%a in ('"WMIC NICConfig where IPEnabled="True" get DefaultIPGateway /value | find "I" "') do set ip=%%~a
  15. call :colorPrint 07 "#####################################################################"
  16. echo.
  17. call :colorPrint 07 "#"
  18. call :colorPrint 02 " Welcome"
  19. call :colorPrint 06 " %username%"
  20. call :colorPrint 02 "! Your DefualtGateway is:"
  21. call :colorPrint 06 " %ip%"
  22. echo.
  23. call :colorPrint 07 "#####################################################################"
  24. echo.
  25. call :colorPrint 07 "#"
  26. call :colorPrint 02 " We will now walk you through how to"
  27. call :colorPrint 06 " PortForward"
  28. call :colorPrint 02 "!"
  29. echo.
  30. call :colorPrint 07 "#"
  31. call :colorPrint 02 " In your browser that just opened, you should be at an login screen."
  32. echo.
  33. call :colorPrint 07 "#"
  34. call :colorPrint 02 " Your username and password by defualt is"
  35. call :colorPrint 06 " Admin"
  36. call :colorPrint 02 "."
  37. echo.
  38. call :colorPrint 07 "#"
  39. echo.
  40. call :colorPrint 07 "#"
  41. call :colorPrint 02 " The next thing you will need to do is locate your port-forwarding"
  42. echo.
  43. call :colorPrint 07 "#"
  44. call :colorPrint 02 " tab. Should be under"
  45. call :colorPrint 06 " Firewall > NAT/Gaming"
  46. call :colorPrint 02 " on your dashboard."
  47. echo.
  48. call :colorPrint 07 "#"
  49. call :colorPrint 02 " - Some routers will require an"
  50. call :colorPrint 06 " Acess Code"
  51. call :colorPrint 02 ". Enter that now."
  52. echo.
  53. call :colorPrint 07 "#"
  54. call :colorPrint 02 " "
  55. echo.
  56. call :colorPrint 07 "#"
  57. call :colorPrint 02 " Now under your
  58. call :colorPrint 06 " NAT/Gaming"
  59. call :colorPrint 02 " tab, select"
  60. call :colorPrint 06 " Custom Services"
  61. echo.
  62. call :colorPrint 07 "#"
  63. call :colorPrint 02 " from your"
  64. call :colorPrint 06 " Manage Custom Services"
  65. call :colorPrint 02 " section."
  66. echo.
  67. call :colorPrint 07 "#"
  68. call :colorPrint 02 " This is where you want to add your port. For this"
  69. call :colorPrint 02 " example we will"
  70. echo.
  71. call :colorPrint 07 "#"
  72. call :colorPrint 02 " use '7777' as our port."
  73. echo.
  74. call :colorPrint 07 "#"
  75. call :colorPrint 02 "
  76. echo.
  77. call :colorPrint 07 "#"
  78. call :colorPrint 02 " For"
  79. call :colorPrint 06 " Service Name"
  80. call :colorPrint 02 " put a name for your custom port. For"
  81. echo.
  82. call :colorPrint 07 "#"
  83. call :colorPrint 06 " Global Port Range"
  84. call :colorPrint 02 " and"
  85. call :colorPrint 06 " Base Host Port"
  86. call :colorPrint 02 " Put 7777. Set"
  87. call :colorPrint 06 " Protocol"
  88. call :colorPrint 02 " to"
  89. echo.
  90. call :colorPrint 07 "#"
  91. call :colorPrint 02 " be"
  92. call :colorPrint 06 " TCP/UDP"
  93. call :colorPrint 02 ". Click save."
  94. echo.
  95. call :colorPrint 07 "#####################################################################"
  96. echo.
  97. call :colorPrint 07 "#"
  98. call :colorPrint 02 " Now opening"
  99. call :colorPrint 06 " %ip%"
  100. call :colorPrint 02 " in your explorer..."
  101. echo.
  102. call :colorPrint 07 "#####################################################################"
  103. echo.
  104. start iexplore "%ip%"
  105.  
  106. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  107. ::END Code
  108.  
  109. call :colorPrintVar 74 complex /n
  110. call :cleanupColorPrint
  111. exit /b
  112.  
  113. :colorPrint Color Str [/n]
  114. setlocal
  115. set "str=%~2"
  116. call :colorPrintVar %1 str %3
  117. exit /b
  118.  
  119. :colorPrintVar Color StrVar [/n]
  120. if not defined %~2 exit /b
  121. setlocal enableDelayedExpansion
  122. set "str=a%DEL%!%~2:\=a%DEL%\..\%DEL%%DEL%%DEL%!"
  123. set "str=!str:/=a%DEL%/..\%DEL%%DEL%%DEL%!"
  124. set "str=!str:"=\"!"
  125. pushd "%temp%"
  126. findstr /p /A:%1 "." "!str!\..\x" nul
  127. if /i "%~3"=="/n" echo(
  128. exit /b
  129.  
  130. :initColorPrint
  131. for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do set "DEL=%%a"
  132. <nul >"%temp%\x" set /p "=%DEL%%DEL%%DEL%%DEL%%DEL%%DEL%.%DEL%"
  133. exit /b
  134.  
  135. :cleanupColorPrint
  136. del "%temp%\x"
  137. goto :done
  138.  
  139. :done
  140. pause >nul
RAW Paste Data