You are on page 1of 1

@echo off

set IP_PROXY=202.152.240.50
set IP_CLIENT_FILE=%temp%\TSEL_IP.txt
set LOG_FILE="%~dp0"TSEL_LOG.txt
IF EXIST %LOG_FILE% (del %LOG_FILE%.)
REM ***************** DETEKSI ALAMAT IP *********************
echo [%Date% %Time%] : Mendeteksi alamat IP Client... >> %LOG_FILE%
IPCONFIG | FIND "IPv4 Address" > %IP_CLIENT_FILE%
FOR /F "tokens=2 delims=:" %%a in (%IP_CLIENT_FILE%) do set IP=%%a
del %IP_CLIENT_FILE%
set IP=%IP:~1%
echo Alamat IP Anda sekarang: "%IP%"
echo [%Date% %Time%] : Alamat IP Client = %IP% >> %LOG_FILE%
REM *********************************************************
echo.
echo.
REM ********************* ROUTING ***************************
echo Menghapus route ke 0.0.0.0 ...
echo [%Date% %Time%] : Menghapus route 0.0.0.0 ... >> %LOG_FILE%
route delete 0.0.0.0 >> %LOG_FILE%
echo.
echo Menambahkan route ke Proxy = %IP_PROXY%...
echo [%Date% %Time%] : Menambahkan proxy 10.1.89.130= %IP_PROXY%... >> %LOG_FILE
%
route add %IP_PROXY% %IP% >> %LOG_FILE%
echo.
REM *********************************************************
echo Menampilkan daftar route...
echo [%Date% %Time%] : Menampilkan daftar route... >> %LOG_FILE%
echo.
route print >> %LOG_FILE%
route print
REM
set
set
set
set
REM

******************** CLEANING UP ************************


IP_PROXY=
IP_CLIENT_FILE=
LOG_FILE=
IP=
*********************************************************

pause