10月 122018
 

ひどいめぽ

WindowNameTaskKill.bat

@echo off
setlocal
if not ""=="%~2" (timeout /T %~2)
for /F "usebackq tokens=2" %%a in (
`tasklist /FI "WINDOWTITLE eq %~1" ^| findstr "[0-9]"`
) do (
taskkill /F /T /PID %%a > NUL
)
exit /b

hoge.bat

@echo off
setlocal

set TimeOutSec=10

goto mRun

:sLoD
ping -w 500 -n 1 %~1 | find "ms TTL=" > NUL
if not errorlevel 0 goto LoD
exit /b

:sWnR
call cmd /c ipconfig /flushdns
start "WindowNameTaskKill - %~1" cmd /c WindowNameTaskKill "%~1" %TimeOutSec%
start "%~1" /WAIT tracert -d -4 -w 500 %~2
call cmd /c WindowNameTaskKill "WindowNameTaskKill - %~1"
exit /b

:sRun
call :sLoD "172.16.0.2"
call :sWnR "%~1" "%~2"
exit /b

:mRun
for /l %%i in (1;1;3) do (
call :sRun "Window Number %%i" "one.one.one.one"
)
exit /b

現在コメント投稿は停止しております。