메크로

tracert.bat 경로추적 텍스트 파일로 저장

holy1017 2015. 2. 5. 11:41

@echo off

cls


:: IP 설정


set ip="%1"

if "%1"=="" set ip=www.naver.com

if "%ip%"=="" goto end


:: 파일명 설정


md "%~DP0%ip%"

set FILE="%~DP0%ip%\%date%.txt"

:: %time:~0,2%_%time:~3,2%_%time:~6,2%.txt"


echo.>>%FILE%

echo =============================>>%FILE%

echo start : %date% %time%>>%FILE%


echo %ip%

echo Working . . . . .

%WINDIR%\System32\tracert %ip% >> %FILE%


echo.>>%FILE%

echo end : %date% %time%>>%FILE%

echo =============================>>%FILE%


exit



:end

echo.

echo ip값이나 주소값이 없습니다.

echo 실행방법

echo tracert.bat [ip 또는 인터넷주소]

echo 예)tracert.bat www.naver.com

pause

exit