View Full Version : paus batch file


JT
03-20-2004, 03:57 PM
Hi, I wont to paus a batch file for a few seconds, what command do I use?
( OS WinXP)

Ray McCormick
03-20-2004, 04:24 PM
"JT" <J.ct@gmx.net> wrote in message
news:c3hpkh$s53$01$1@news.t-online.com...
> Hi, I wont to paus a batch file for a few seconds, what command
do I use?
> ( OS WinXP)
>
>

Use sleep.exe

This is available from, amongst others,
http://www.gammadyne.com/cmdline.htm
(for 9x/ME/2000/XP)

Regards

Ray

Ray McCormick
03-20-2004, 04:24 PM
"JT" <J.ct@gmx.net> wrote in message
news:c3hpkh$s53$01$1@news.t-online.com...
> Hi, I wont to paus a batch file for a few seconds, what command
do I use?
> ( OS WinXP)
>
>

Use sleep.exe

This is available from, amongst others,
http://www.gammadyne.com/cmdline.htm
(for 9x/ME/2000/XP)

Regards

Ray

Torgeir Bakken \(MVP\)
03-20-2004, 04:38 PM
JT wrote:

> Hi, I wont to paus a batch file for a few seconds, what
> command do I use? ( OS WinXP)
Hi

Alternatively, do a sleep using ping.exe (not CPU intensive).

Sleep approx. 5 seconds (number behind -n is seconds +1):

ping.exe -n 6 127.0.0.1 >nul



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx

Torgeir Bakken \(MVP\)
03-20-2004, 04:38 PM
JT wrote:

> Hi, I wont to paus a batch file for a few seconds, what
> command do I use? ( OS WinXP)
Hi

Alternatively, do a sleep using ping.exe (not CPU intensive).

Sleep approx. 5 seconds (number behind -n is seconds +1):

ping.exe -n 6 127.0.0.1 >nul



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx

Paul R. Sadowski
03-20-2004, 06:02 PM
"Ray McCormick" <raymond.mccormick@ntlworld.com> wrote in message
news:%23qAMzepDEHA.3584@TK2MSFTNGP11.phx.gbl...
> "JT" <J.ct@gmx.net> wrote in message
> news:c3hpkh$s53$01$1@news.t-online.com...
>> Hi, I wont to paus a batch file for a few seconds, what command
> do I use?
>> ( OS WinXP)
>>
>>
>
> Use sleep.exe
>
> This is available from, amongst others,
> http://www.gammadyne.com/cmdline.htm
> (for 9x/ME/2000/XP)

That program is a power management tool.

My little package contains the kind of sleep command he wants.
http://www.paulsadowski.com/WSH/cmdprogs.htm

Sleep.exe
Waits for specified number of seconds to pass.
sleep: sleep-time-in-seconds

Example:
rem sleep for 5 minutes
sleep 300

Paul R. Sadowski
03-20-2004, 06:02 PM
"Ray McCormick" <raymond.mccormick@ntlworld.com> wrote in message
news:%23qAMzepDEHA.3584@TK2MSFTNGP11.phx.gbl...
> "JT" <J.ct@gmx.net> wrote in message
> news:c3hpkh$s53$01$1@news.t-online.com...
>> Hi, I wont to paus a batch file for a few seconds, what command
> do I use?
>> ( OS WinXP)
>>
>>
>
> Use sleep.exe
>
> This is available from, amongst others,
> http://www.gammadyne.com/cmdline.htm
> (for 9x/ME/2000/XP)

That program is a power management tool.

My little package contains the kind of sleep command he wants.
http://www.paulsadowski.com/WSH/cmdprogs.htm

Sleep.exe
Waits for specified number of seconds to pass.
sleep: sleep-time-in-seconds

Example:
rem sleep for 5 minutes
sleep 300

JT
03-21-2004, 10:30 AM
thanks to all I'll try out the sleep.exe

"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> schrieb im
Newsbeitrag news:eKS1cnpDEHA.3568@tk2msftngp13.phx.gbl...
> JT wrote:
>
> > Hi, I wont to paus a batch file for a few seconds, what
> > command do I use? ( OS WinXP)
> Hi
>
> Alternatively, do a sleep using ping.exe (not CPU intensive).
>
> Sleep approx. 5 seconds (number behind -n is seconds +1):
>
> ping.exe -n 6 127.0.0.1 >nul
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/community/scriptcenter/default.mspx

JT
03-21-2004, 10:30 AM
thanks to all I'll try out the sleep.exe

"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> schrieb im
Newsbeitrag news:eKS1cnpDEHA.3568@tk2msftngp13.phx.gbl...
> JT wrote:
>
> > Hi, I wont to paus a batch file for a few seconds, what
> > command do I use? ( OS WinXP)
> Hi
>
> Alternatively, do a sleep using ping.exe (not CPU intensive).
>
> Sleep approx. 5 seconds (number behind -n is seconds +1):
>
> ping.exe -n 6 127.0.0.1 >nul
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/community/scriptcenter/default.mspx

Ray McCormick
03-21-2004, 02:34 PM
Oops! Wrong one.

sleep.exe from Gammadyne is 124k,
sleep.exe from Sadowski is 83.2k and
the one I have been using for some time (same syntax as Paul
Sadowski's; I did not make a note of where I got it from) is
25.4k !
I did not know there were so many programs of the same name - a
good job someone is awake.

Regards

Ray

"Paul R. Sadowski" <xpert@mailshell13.mailshell.com> wrote in
message news:umyR1VqDEHA.1240@TK2MSFTNGP10.phx.gbl...
>
> "Ray McCormick" <raymond.mccormick@ntlworld.com> wrote in
message
> news:%23qAMzepDEHA.3584@TK2MSFTNGP11.phx.gbl...
> > "JT" <J.ct@gmx.net> wrote in message
> > news:c3hpkh$s53$01$1@news.t-online.com...
> >> Hi, I wont to paus a batch file for a few seconds, what
command
> > do I use?
> >> ( OS WinXP)
> >>
> >>
> >
> > Use sleep.exe
> >
> > This is available from, amongst others,
> > http://www.gammadyne.com/cmdline.htm
> > (for 9x/ME/2000/XP)
>
> That program is a power management tool.
>
> My little package contains the kind of sleep command he wants.
> http://www.paulsadowski.com/WSH/cmdprogs.htm
>
> Sleep.exe
> Waits for specified number of seconds to pass.
> sleep: sleep-time-in-seconds
>
> Example:
> rem sleep for 5 minutes
> sleep 300
>
>
>
>

Ray McCormick
03-21-2004, 02:34 PM
Oops! Wrong one.

sleep.exe from Gammadyne is 124k,
sleep.exe from Sadowski is 83.2k and
the one I have been using for some time (same syntax as Paul
Sadowski's; I did not make a note of where I got it from) is
25.4k !
I did not know there were so many programs of the same name - a
good job someone is awake.

Regards

Ray

"Paul R. Sadowski" <xpert@mailshell13.mailshell.com> wrote in
message news:umyR1VqDEHA.1240@TK2MSFTNGP10.phx.gbl...
>
> "Ray McCormick" <raymond.mccormick@ntlworld.com> wrote in
message
> news:%23qAMzepDEHA.3584@TK2MSFTNGP11.phx.gbl...
> > "JT" <J.ct@gmx.net> wrote in message
> > news:c3hpkh$s53$01$1@news.t-online.com...
> >> Hi, I wont to paus a batch file for a few seconds, what
command
> > do I use?
> >> ( OS WinXP)
> >>
> >>
> >
> > Use sleep.exe
> >
> > This is available from, amongst others,
> > http://www.gammadyne.com/cmdline.htm
> > (for 9x/ME/2000/XP)
>
> That program is a power management tool.
>
> My little package contains the kind of sleep command he wants.
> http://www.paulsadowski.com/WSH/cmdprogs.htm
>
> Sleep.exe
> Waits for specified number of seconds to pass.
> sleep: sleep-time-in-seconds
>
> Example:
> rem sleep for 5 minutes
> sleep 300
>
>
>
>

Paul R. Sadowski
03-21-2004, 06:19 PM
"Ray McCormick" <raymond.mccormick@ntlworld.com> wrote in message
news:eQeqQG1DEHA.3408@tk2msftngp13.phx.gbl...
> Oops! Wrong one.
>
> sleep.exe from Gammadyne is 124k,
> sleep.exe from Sadowski is 83.2k and
> the one I have been using for some time (same syntax as Paul
> Sadowski's; I did not make a note of where I got it from) is
> 25.4k !

The one from the resource kit is just over 5K.

About 200 bytes :-)

args = WScript.Arguments.Count
if args <> 1 then
Wscript.Echo "usage: " & Wscript.ScriptName & " time-to-sleep-in-seconds"
wscript.Quit
end if

wscript.sleep 1000 * WScript.Arguments.Item(0)

85 bytes:
:sleep
:: sleep for x number of seconds
ping -n %1 127.0.0.1 > NUL 2>&1
goto :EOF

Problem with these is software firewalls and AV's my block them and stop
them from working.

Paul R. Sadowski
03-21-2004, 06:19 PM
"Ray McCormick" <raymond.mccormick@ntlworld.com> wrote in message
news:eQeqQG1DEHA.3408@tk2msftngp13.phx.gbl...
> Oops! Wrong one.
>
> sleep.exe from Gammadyne is 124k,
> sleep.exe from Sadowski is 83.2k and
> the one I have been using for some time (same syntax as Paul
> Sadowski's; I did not make a note of where I got it from) is
> 25.4k !

The one from the resource kit is just over 5K.

About 200 bytes :-)

args = WScript.Arguments.Count
if args <> 1 then
Wscript.Echo "usage: " & Wscript.ScriptName & " time-to-sleep-in-seconds"
wscript.Quit
end if

wscript.sleep 1000 * WScript.Arguments.Item(0)

85 bytes:
:sleep
:: sleep for x number of seconds
ping -n %1 127.0.0.1 > NUL 2>&1
goto :EOF

Problem with these is software firewalls and AV's my block them and stop
them from working.