I have a batch script that is executed outside of an interactive command prompt. I want to sleep for 30 seconds between two commands in it?
I've read in some responses to similar questions that you can use timeout
or choice
, but these fail in a non-interactive session.
ERROR: Input redirection is not supported, exiting the process immediately.
I've read in other responses to similar questions that you can use waitfor
, but this will set an error level and I rely on those in the overall script.
I've seen using a ping that will fail ping -n 1 -w 30000 192.168.not.reachable > NUL
and this appears to work, but that just seems wrong and I can't rely on an single IP being not reachable on all systems I'll deploy to.
Is there another way for me to try?
Thanks.
EDITS:
This answer (How to sleep in a batch file?) definitely has related material, but doesn't address the need for a solution that works outside an interactive shell. It does mention the only alternative I have now: ping
, but as I ask above, I'm looking for alternatives.
Also, thanks for the PowerShell suggestions, but that's not possible now.