Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ::Port-Forward Guide Via Batch ::
- ::Created by RU$$ [http://russdev.mooo.com/] ::
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- @ECHO OFF
- @SETLOCAL
- @TITLE PORTFORWARD GUIDE
- call :initColorPrint
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ::START Code
- set ip=
- for /f "tokens=2,3 delims={,}" %%a in ('"WMIC NICConfig where IPEnabled="True" get DefaultIPGateway /value | find "I" "') do set ip=%%~a
- call :colorPrint 07 "#####################################################################"
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 02 " Welcome"
- call :colorPrint 06 " %username%"
- call :colorPrint 02 "! Your DefualtGateway is:"
- call :colorPrint 06 " %ip%"
- echo.
- call :colorPrint 07 "#####################################################################"
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 02 " We will now walk you through how to"
- call :colorPrint 06 " PortForward"
- call :colorPrint 02 "!"
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 02 " In your browser that just opened, you should be at an login screen."
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 02 " Your username and password by defualt is"
- call :colorPrint 06 " Admin"
- call :colorPrint 02 "."
- echo.
- call :colorPrint 07 "#"
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 02 " The next thing you will need to do is locate your port-forwarding"
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 02 " tab. Should be under"
- call :colorPrint 06 " Firewall > NAT/Gaming"
- call :colorPrint 02 " on your dashboard."
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 02 " - Some routers will require an"
- call :colorPrint 06 " Acess Code"
- call :colorPrint 02 ". Enter that now."
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 02 " "
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 02 " Now under your
- call :colorPrint 06 " NAT/Gaming"
- call :colorPrint 02 " tab, select"
- call :colorPrint 06 " Custom Services"
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 02 " from your"
- call :colorPrint 06 " Manage Custom Services"
- call :colorPrint 02 " section."
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 02 " This is where you want to add your port. For this"
- call :colorPrint 02 " example we will"
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 02 " use '7777' as our port."
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 02 "
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 02 " For"
- call :colorPrint 06 " Service Name"
- call :colorPrint 02 " put a name for your custom port. For"
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 06 " Global Port Range"
- call :colorPrint 02 " and"
- call :colorPrint 06 " Base Host Port"
- call :colorPrint 02 " Put 7777. Set"
- call :colorPrint 06 " Protocol"
- call :colorPrint 02 " to"
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 02 " be"
- call :colorPrint 06 " TCP/UDP"
- call :colorPrint 02 ". Click save."
- echo.
- call :colorPrint 07 "#####################################################################"
- echo.
- call :colorPrint 07 "#"
- call :colorPrint 02 " Now opening"
- call :colorPrint 06 " %ip%"
- call :colorPrint 02 " in your explorer..."
- echo.
- call :colorPrint 07 "#####################################################################"
- echo.
- start iexplore "%ip%"
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ::END Code
- call :colorPrintVar 74 complex /n
- call :cleanupColorPrint
- exit /b
- :colorPrint Color Str [/n]
- setlocal
- set "str=%~2"
- call :colorPrintVar %1 str %3
- exit /b
- :colorPrintVar Color StrVar [/n]
- if not defined %~2 exit /b
- setlocal enableDelayedExpansion
- set "str=a%DEL%!%~2:\=a%DEL%\..\%DEL%%DEL%%DEL%!"
- set "str=!str:/=a%DEL%/..\%DEL%%DEL%%DEL%!"
- set "str=!str:"=\"!"
- pushd "%temp%"
- findstr /p /A:%1 "." "!str!\..\x" nul
- if /i "%~3"=="/n" echo(
- exit /b
- :initColorPrint
- for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do set "DEL=%%a"
- <nul >"%temp%\x" set /p "=%DEL%%DEL%%DEL%%DEL%%DEL%%DEL%.%DEL%"
- exit /b
- :cleanupColorPrint
- del "%temp%\x"
- goto :done
- :done
- pause >nul
Add Comment
Please, Sign In to add comment