PC Review
Forums
Newsgroups
Windows 2000
Microsoft Windows 2000 CMD Promt
Windows XP Sleep Command
Forums
Newsgroups
Windows 2000
Microsoft Windows 2000 CMD Promt
Windows XP Sleep Command
![]() |
Windows XP Sleep Command |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Sorry couldn't find a windows XP group to post this to !.
Under a default Windows XP install there doesn't seem to be a sleep command available at the command prompt ? Has this been replaced or just removed. I need to pause the execution of a script for a period of time in an automated way. any ideas ? thanks, Steve |
|
|
|
#2 |
|
Guest
Posts: n/a
|
"Steven Adams" wrote:
>Sorry couldn't find a windows XP group to post this to !. > >Under a default Windows XP install there doesn't seem to be a sleep command >available at the command prompt ? >Has this been replaced or just removed. >I need to pause the execution of a script for a period of time in an >automated way. >any ideas ? > There is a sleep in w2k reskit which isn't free. When networking/tcp installes use as an alternative: ping -n xx 127.0.0.1 >NUL where xx is the number of seconds to pause. -- Greetings Matthias________________________________________ For help on nt commands enter in a cmd window: W2K>HH windows.chm::ntcmds.htm XP>HH ntcmds.chm |
|
|
|
#3 |
|
Guest
Posts: n/a
|
As far as I know sleep has never been part of the standard OS but is in the
resource kit. There are also freeware sleep.exe around the web. Here's two methods without going to an additional prog. -------------------------------------------------------------------------------- call sleep 10 :sleep :: sleep for x number of seconds ping -n %1 127.0.0.1 > NUL 2>&1 goto :EOF -------------------------------------------------------------------------------- cscript sleep.vbs 10 where sleep.vbs is: args = wScript.Arguments.Count if args <> 1 then wscript.Echo "usage: " & Wscript.ScriptName & " seconds to sleep" & _ vbCRLF & "Example: " & Wscript.ScriptName & " 10" wscript.Quit end if wscript.sleep wscript.Arguments.Item(0) * 1000 -------------------------------------------------------------------------------- Problems: firewalls could screwup ping either by disallowing it or by not being configured for it and asking the user for what to do with it. sleep.vbs is not accurate because it may take a couple of second to initialize. So 10 second delay might be 12 or even 13. Also, anti-virus programs can be set to block scripts and some people even change the scripting associations. But if you know the machine(s) then these might do, or not. Only you can decide. "Steven Adams" <steven.adams@nospam.co.nz> wrote in message news:%230CH48XzDHA.1740@TK2MSFTNGP09.phx.gbl... > Sorry couldn't find a windows XP group to post this to !. > > Under a default Windows XP install there doesn't seem to be a sleep > command > available at the command prompt ? > Has this been replaced or just removed. > I need to pause the execution of a script for a period of time in an > automated way. > any ideas ? > > thanks, > > Steve > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
On Sun, 28 Dec 2003 16:17:23 -0500, "Paul R. Sadowski"
<xpert@mailshell13.mailshell.com> wrote: >call sleep 10 >:sleep >:: sleep for x number of seconds >ping -n %1 127.0.0.1 > NUL 2>&1 >goto :EOF >Problems: >firewalls could screwup ping either by disallowing it or by not being >configured for it and asking the user for what to do with it. Pinging 127.0.0.1, actually any address starting with 127, will not cause any IP packets to leave the computer, much less hit any firewall. The 127 range contains only loopback addresses. Try unplugging the network connection and then running the script. Replies will still happen. Also note that to be closer to accurate that the parameter should be one larger. In other words to sleep for 10 seconds use the following: ping -n 11 127.0.0.1 >NUL It doesn't make that much difference, but it could. Clay Calvert CCalvert@Wanguru.com Replace "W" with "L" |
|
|
|
#5 |
|
Guest
Posts: n/a
|
"Clay Calvert" <ccalvert@Wanguru.com> wrote in message
news:cmuuuv4sajvprfaulq9a7gscrpttk2cj3j@4ax.com... > Pinging 127.0.0.1, actually any address starting with 127, will not > cause any IP packets to leave the computer, much less hit any > firewall. I'm talking about software firewalls. I don't like them but had to test one and pinging the localhost did set off the warning asking me whether to allow it or not. |
|
|
|
#6 |
|
Guest
Posts: n/a
|
On Sun, 28 Dec 2003 21:05:11 -0500, "Paul R. Sadowski"
<xpert@mailshell13.mailshell.com> wrote: >"Clay Calvert" <ccalvert@Wanguru.com> wrote in message >news:cmuuuv4sajvprfaulq9a7gscrpttk2cj3j@4ax.com... >> Pinging 127.0.0.1, actually any address starting with 127, will not >> cause any IP packets to leave the computer, much less hit any >> firewall. > >I'm talking about software firewalls. I don't like them but had to test one >and pinging the localhost did set off the warning asking me whether to allow >it or not. Gotcha. Good point. Clay Calvert CCalvert@Wanguru.com Replace "W" with "L" |
|
|
|
#7 |
|
Guest
Posts: n/a
|
jsleep on the free win32 tools page of www.joeware.net
-- Joe Richards www.joeware.net -- "Steven Adams" <steven.adams@nospam.co.nz> wrote in message news:%230CH48XzDHA.1740@TK2MSFTNGP09.phx.gbl... > Sorry couldn't find a windows XP group to post this to !. > > Under a default Windows XP install there doesn't seem to be a sleep command > available at the command prompt ? > Has this been replaced or just removed. > I need to pause the execution of a script for a period of time in an > automated way. > any ideas ? > > thanks, > > Steve > > |
|
|
|
#8 |
|
Guest
Posts: n/a
|
"Steven Adams" <steven.adams@nospam.co.nz> wrote:
> Under a default Windows XP install there doesn't seem to be a sleep command > available at the command prompt ? 19} How can one build a delay / sleep / wait procedure for a script? 56675 Dec 27 2003 ftp://garbo.uwasa.fi/pc/link/tscmd.zip tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi All the best, Timo -- Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5 Department of Accounting and Business Finance ; University of Vaasa mailto:ts@uwasa.fi <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland Timo's FAQ materials at http://www.uwasa.fi/~ts/http/tsfaq.html |
|
|
|
#9 |
|
Guest
Posts: n/a
|
Here's mine. Unfortunately my host is now disallowing exe's so I had to zip
it. http://paulsadowski.com/scripts/dow...sp?fn=sleep.zip C:\bin [(firecat) 15:14, Tue 12/30/2003] sleep sleep: sleep-time-in-seconds |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

