얼마전 ping 테스트 를 며칠 걸어둘일이 있었다..
중간에 이빨나간부분이 언제인지 그게참 궁금했는데 ;

어떻게 하면 방법이 없을까.. 하다가
(choice 가 안된다고 해서..;; )

까먹고 즐겨찾기 정리중에 bat 파일 에 관한 설명글이 있었다..
http://blog.naver.com/kieuns?Redirect=Log&logNo=80018742692

일종의 편법.. 변수를 써서 .. ㅋ

저분글이 도움이 됐다..
어설프지만
타임한번치고 핑테스트하고
좀더 세련되게 만들면 더 좋겠지만.. ;
cmd 커멘드로는 여기까지..

자바로 만들어봐야겠다..

소스..

@echo off
cls
echo ************************
echo *  Ping test logging.  *
echo ************************

:start
if not '%1'=='' (goto top)  else goto end2

:top
echo ※ Ping testing Force close "^C" and type "Y".
echo.
echo 1. Save Ping test
echo 2. Print Ping test
echo 3. Sample
echo 4. End
echo.
set choice=
set /p choice=Type the number to print text :
if '%choice%'=='' goto notchoice
if '%choice%'=='1' goto save
if '%choice%'=='2' goto print
if '%choice%'=='3' goto sample
if '%choice%'=='4' goto end
cls
echo.
echo. "%choice%" is not valid please try again
echo.
set choice=
goto start

:notchoice
cls
echo.
echo. Type number 1, 2, 3.
echo.
goto top

:save
echo.
echo. |TIME >> pingtest_%1.txt
echo. |PING %1 -n 10 >> pingtest_%1.txt
echo.
goto save

:print
echo.
echo. |TIME
echo. |PING %1 -n 10
echo.
goto print

:sample
echo.
echo. |TIME
echo. |PING %1 -n 10
echo.
goto start

:end2
echo Type IP address.
echo ex) pt 168.126.63.1

:end
echo.
echo Thank.


-----------------------
샘플
-----------------------

현재 시간: 10:14:00.06
새로운 시간을 입력하십시오: 


Pinging 168.126.63.1 with 32 bytes of data:


Reply from 168.126.63.1: bytes=32 time=2ms TTL=57

Reply from 168.126.63.1: bytes=32 time=2ms TTL=57

Reply from 168.126.63.1: bytes=32 time=1ms TTL=57

Reply from 168.126.63.1: bytes=32 time=1ms TTL=57

Reply from 168.126.63.1: bytes=32 time=1ms TTL=57

Reply from 168.126.63.1: bytes=32 time=1ms TTL=57

Reply from 168.126.63.1: bytes=32 time=1ms TTL=57

Reply from 168.126.63.1: bytes=32 time=1ms TTL=57

Reply from 168.126.63.1: bytes=32 time=1ms TTL=57

Reply from 168.126.63.1: bytes=32 time=1ms TTL=57


Ping statistics for 168.126.63.1:

    Packets: Sent = 10, Received = 10, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

    Minimum = 1ms, Maximum = 2ms, Average = 1ms

YOUR COMMENT IS THE CRITICAL SUCCESS FACTOR FOR THE QUALITY OF BLOG POST