1.

Solve : Help for sleep command in batch script?

Answer»

Dear All,

I am new bie for windows scripting environment.
I am facing a strange issue.

I have two files First.bat is running all the time and code is

****************
:START

Second.cmd

sleep 1000

goto :START
****************

second file has some piece of instruction to accomplish some task.
when I RUN this first time or second time it works FINE, i.e. sleep for some time and then start processing again.
However after that I obsereved If I press enter than only script resumes else keep on sleeping no matter what time we have provided :|

Could you please advise, where I am missing.
Also I have given "sleep 500" in second.cmd as well. However not stuck at that poing, stuck only at sleep in first.bat.

Kindly advise.

Thank you,
SUNIL Somani
In place of sleep, i have also created delays using ping command such as

Ping 127.0.0.1 -n 60 >pingdelay.txt

Where -n 60 tells it to count 60 ( *about 60 seconds ) and >pingdelay.txt is where the ping OUTPUT is echo'd off to to avoid seeing the pings scrolling. 60 can be changed to any NUMBER to have proper delay.

After this instruction is executed it will move on to the next instruction without delay that you are having.



Discussion

No Comment Found