How do I pause 10 seconds in batch file?

C

Cyborg

I want to have a batch file stop a service then wait 10 seconds before
restarting it again, what is the command.

Net stop service
pause 10
Net start service
 
P

Pegasus \(MVP\)

Cyborg said:
I want to have a batch file stop a service then wait 10 seconds before
restarting it again, what is the command.

Net stop service
pause 10
Net start service

Try this:

Net stop service
ping localhost -n 11 > nul
Net start service
 
L

Lanwench [MVP - Exchange]

In
Cyborg said:
I want to have a batch file stop a service then wait 10 seconds before
restarting it again, what is the command.

Net stop service
pause 10
Net start service

Sleep.exe (from the resource kit, I believe).

net stop service
sleep 10
net start service
 
G

Gonzo

How do I get te command line to recognize sleep? I have dowloaded these
reskit.


"Lanwench [MVP - Exchange]"
 
L

Lanwench [MVP - Exchange]

In
Gonzo said:
How do I get te command line to recognize sleep? I have dowloaded
these reskit.

If you downloaded rktools.exe, you need to run/install it. It should add the
installation location to your system path (reboot if it doesn't) and you
should be able to run it from a command line in any folder.
"Lanwench [MVP - Exchange]"
In

Sleep.exe (from the resource kit, I believe).

net stop service
sleep 10
net start service
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top