Jump to content

wait/sleep command


Recommended Posts

Guest yepiknowiam
Posted

Is there a wait/sleep equilivant command for the command prompt? I know

there is wscript.sleep for vbs files.

 

I'm running a batch file and want to it pause a few seconds between commands.

 

Haven't found much from microsoft. There is the waitfor command but it

wasn't recognized.

 

Thanks.

  • Replies 10
  • Created
  • Last Reply
Guest Bob I
Posted

Re: wait/sleep command

 

Use

 

ping -n XXX 127.0.0.1

 

replace XXX with the desired number of seconds +1

 

 

yepiknowiam wrote:

> Is there a wait/sleep equilivant command for the command prompt? I know

> there is wscript.sleep for vbs files.

>

> I'm running a batch file and want to it pause a few seconds between commands.

>

> Haven't found much from microsoft. There is the waitfor command but it

> wasn't recognized.

>

> Thanks.

Guest 3c273
Posted

Re: wait/sleep command

 

Poor man's sleep timer:

ping localhost -n (number of seconds to sleep)

Louis

 

"yepiknowiam" <yepiknowiam@discussions.microsoft.com> wrote in message

news:37466D6D-894F-4104-B902-9986487E4FE2@microsoft.com...

> Is there a wait/sleep equilivant command for the command prompt? I know

> there is wscript.sleep for vbs files.

>

> I'm running a batch file and want to it pause a few seconds between

commands.

>

> Haven't found much from microsoft. There is the waitfor command but it

> wasn't recognized.

>

> Thanks.

Guest 3c273
Posted

Re: wait/sleep command

 

Oops, that sould have been

ping -n (number of seconds to sleep) localhost

Louis

 

"yepiknowiam" <yepiknowiam@discussions.microsoft.com> wrote in message

news:37466D6D-894F-4104-B902-9986487E4FE2@microsoft.com...

> Is there a wait/sleep equilivant command for the command prompt? I know

> there is wscript.sleep for vbs files.

>

> I'm running a batch file and want to it pause a few seconds between

commands.

>

> Haven't found much from microsoft. There is the waitfor command but it

> wasn't recognized.

>

> Thanks.

Guest Pegasus \(MVP\)
Posted

Re: wait/sleep command

 

 

"3c273" <nospam@nospam.com> wrote in message

news:g0kfdt0mli@enews4.newsguy.com...

> Oops, that sould have been

> ping -n (number of seconds to sleep) localhost

> Louis

 

The order of the parameters is irrelevant.

Guest yepiknowiam
Posted

Re: wait/sleep command

 

Thanks. That did the trick. I'll have to remember that command.

 

"Pegasus (MVP)" wrote:

>

> "3c273" <nospam@nospam.com> wrote in message

> news:g0kfdt0mli@enews4.newsguy.com...

> > Oops, that sould have been

> > ping -n (number of seconds to sleep) localhost

> > Louis

>

> The order of the parameters is irrelevant.

>

>

>

Guest 3c273
Posted

Re: wait/sleep command

 

Somehow I thought I left out localhost on the first one. Still asleep I

guess.

 

Louis

 

"Pegasus (MVP)" <I.can@fly.com.oz> wrote in message

news:OuCTqo3tIHA.4476@TK2MSFTNGP06.phx.gbl...

>

> "3c273" <nospam@nospam.com> wrote in message

> news:g0kfdt0mli@enews4.newsguy.com...

> > Oops, that sould have been

> > ping -n (number of seconds to sleep) localhost

> > Louis

>

> The order of the parameters is irrelevant.

>

>

Guest Big Al
Posted

Re: wait/sleep command

 

yepiknowiam wrote:

> Is there a wait/sleep equilivant command for the command prompt? I know

> there is wscript.sleep for vbs files.

>

> I'm running a batch file and want to it pause a few seconds between commands.

>

> Haven't found much from microsoft. There is the waitfor command but it

> wasn't recognized.

>

> Thanks.

 

There is a microsoft resource kit that includes a sleep command you can use.

http://www.microsoft.com/downloadS/details.aspx?familyid=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en

  • 4 weeks later...
Guest Mcribisback
Posted

Re: wait/sleep command

 

 

I tried the ping -n (local) host to use as a Sleep/wait command, but it

runs forever instead of the number of seconds i assign it. I must be

doing something wrong?

 

thanks for the help!

 

 

--

Mcribisback

Guest Bob I
Posted

Re: wait/sleep command

 

ping -n xxx 127.0.0.1

 

(replace xxx with the seconds plus one so for one minute use 61)

 

Mcribisback wrote:

> I tried the ping -n (local) host to use as a Sleep/wait command, but it

> runs forever instead of the number of seconds i assign it. I must be

> doing something wrong?

>

> thanks for the help!

>

>

Guest Mcribisback
Posted

Re: wait/sleep command

 

 

I did actually try that initially, it still keeps looping for some

reason.

 

 

--

Mcribisback


×
×
  • Create New...