「batファイル」timeoutで指定時間毎に同じ処理を繰り返すサンプル

書式
timeout 時間
使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
@echo off
:repeat
ping 172.17.100.xxx
rem 30秒毎に処理を繰り返す
timeout 30
rem 同じ処理を繰り返す
goto repeat
@echo off :repeat ping 172.17.100.xxx rem 30秒毎に処理を繰り返す timeout 30 rem 同じ処理を繰り返す goto repeat
@echo off
:repeat
ping  172.17.100.xxx

rem 30秒毎に処理を繰り返す
timeout 30

rem 同じ処理を繰り返す
goto repeat

 

Cmd

Posted by arkgame