夜遅くまで作成されないパスのスクリプトを一晩実行するバッチを作成しようとしています。パスが存在する場合、ループで合計 12 回チェックする必要があります。存在する場合は、スクリプト テストを開始します。存在しない場合は、1 時間スリープさせてから再度確認します。また、ループが毎回何回ループしたかを教えてもらいたいです。これが私が持っているものです...
@Echo off
cls
set build = %1
set counter = 1
for /l %%a in (1,1,12) do (
if exist {%build%} (
goto StartTest
)
set Timer = %counter% + %Timer%
echo build does not exist. %Timer% out of 12 hours left for the build path to exist or this script will exit.
Sleep 3600000
)
goto end
:StartTest
Echo Starting Tests...
:end
Echo Times up, build path wasn't made
So far this has been the output in cmd:
build does not exist. out of 12 hours left for the build path to exist or this
script will exit stop trying.
'Sleep' is not recognized as an internal or external command,
operable program or batch file.
build does not exist. out of 12 hours left for the build path to exist or this
script will exit stop trying.
'Sleep' is not recognized as an internal or external command,
operable program or batch file.
build does not exist. out of 12 hours left for the build path to exist or this
script will exit stop trying.
'Sleep' is not recognized as an internal or external command,
operable program or batch file.
build does not exist. out of 12 hours left for the build path to exist or this
script will exit stop trying.
'Sleep' is not recognized as an internal or external command,
operable program or batch file.
build does not exist. out of 12 hours left for the build path to exist or this
script will exit stop trying.
'Sleep' is not recognized as an internal or external command,
operable program or batch file.
build does not exist. out of 12 hours left for the build path to exist or this
script will exit stop trying.
'Sleep' is not recognized as an internal or external command,
operable program or batch file.
build does not exist. out of 12 hours left for the build path to exist or this
script will exit stop trying.
'Sleep' is not recognized as an internal or external command,
operable program or batch file.
build does not exist. out of 12 hours left for the build path to exist or this
script will exit stop trying.
'Sleep' is not recognized as an internal or external command,
operable program or batch file.
build does not exist. out of 12 hours left for the build path to exist or this
script will exit stop trying.
'Sleep' is not recognized as an internal or external command,
operable program or batch file.
build does not exist. out of 12 hours left for the build path to exist or this
script will exit stop trying.
'Sleep' is not recognized as an internal or external command,
operable program or batch file.
build does not exist. out of 12 hours left for the build path to exist or this
script will exit stop trying.
'Sleep' is not recognized as an internal or external command,
operable program or batch file.
build does not exist. out of 12 hours left for the build path to exist or this
script will exit stop trying.
'Sleep' is not recognized as an internal or external command,
operable program or batch file.
Times up, build path wasn't made
C:\Users\james\Desktop>
sleep
認識されていないコマンドであり、%Timer%
空白であることに注意してください