China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-25 06:55
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Batch delay command - sleep (my chicken rib collection) View 42,600 Replies 317
Floor 16 Posted 2006-12-22 02:07 ·  中国 浙江 衢州 电信
银牌会员
★★★
Credits 1,270
Posts 548
Joined 2004-05-31 00:00
22-year member
UID 25754
Gender Male
Status Offline
This command is a good thing.
Floor 17 Posted 2007-01-01 04:02 ·  中国 广东 肇庆 端州区 电信
初级用户
★★
Credits 152
Posts 74
Joined 2005-12-01 23:06
20-year member
UID 46314
Status Offline
Floor 18 Posted 2007-01-07 02:31 ·  中国 福建 福州 电信
新手上路
Credits 4
Posts 2
Joined 2007-01-07 02:07
19-year member
UID 75663
Gender Male
Status Offline
Originally posted by ccwan at 2006-11-21 02:09 PM:
When I first started with DOS, I spent a lot of effort looking for sleep.exe and fortunately found it. I've seen many methods for batch processing delays on the internet, and there are indeed highlights in this forum, but few people use the sleep command (non-vbs)..

I also searched for a long time. Oh`` it's called sleep originally
Floor 19 Posted 2007-01-07 11:56 ·  中国 广西 梧州 电信
新手上路
Credits 2
Posts 1
Joined 2006-11-26 06:33
19-year member
UID 71764
Gender Male
Status Offline
Private goods are really different`````````
Floor 20 Posted 2007-01-21 10:27 ·  中国 云南 昆明 电信
初级用户
Credits 57
Posts 29
Joined 2006-12-27 09:36
19-year member
UID 74694
Gender Male
Status Offline
Learned. I have the tool but don't know how to use it. Rarely come into contact with script technology.
Floor 21 Posted 2007-01-22 03:21 ·  中国 广东 深圳 电信
初级用户
Credits 94
Posts 35
Joined 2007-01-09 02:10
19-year member
UID 75886
Gender Male
Status Offline
Using timeout is better. sleep will cause garbled characters!!!
Floor 22 Posted 2007-01-22 05:19 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 866
Posts 415
Joined 2005-12-04 11:19
20-year member
UID 46459
Status Offline
There are so many DOS commands, but there is actually no delay command, and we have to rely on third-party programs.
Floor 23 Posted 2007-01-22 07:47 ·  中国 广东 广州 黄埔区 电信
中级用户
★★
Credits 326
Posts 148
Joined 2005-12-16 12:30
20-year member
UID 47260
Gender Male
Status Offline
Good things are all hoarded privately
Floor 24 Posted 2007-01-23 06:53 ·  中国 四川 绵阳 江油市 电信
高级用户
★★★
Credits 502
Posts 327
Joined 2006-12-30 06:01
19-year member
UID 74981
Gender Male
Status Offline
Originally posted by htysm at 2007-1-21 04:19 PM:
There are so many DOS commands, but there is no delay command, and third-party programs are still required.


I don't agree with this view:

The message sending interval of ping has a time precision of 1 second and is used on the Windows 9x/WinNT series platforms.

Your Windows system needs to have the TCP/IP protocol of the network card normally installed. There are two schemes:

(1) Use the interval time between two message sends of ping. When ping sends multiple messages, after getting the response of the previous message, it will wait for 1 second before sending the next message. The response time varies depending on the model, system, and network configuration. Among them, the IP address 127.0.0.1 is especially crucial because it responds immediately, so it is relatively constant. Most other addresses will have significant differences. This method requires waiting a longer time. The number of messages to send is one more than the waiting time because the first message does not wait. The IP address must be 127.0.0.1. The program to wait for 2 seconds is as follows:
:: According to the planting tree principle, the number after n is one more than the pause seconds
ping -n 3 127.0.0.1>nul
(2) Use the maximum waiting time of ping. ping sends an "Internet Control Message Protocol (ICMP)" echo request message to 0.0.0.1. Because 0.0.0.1 is an IP address that cannot respond to ping requests, by default, ping will wait for a certain maximum response time - it stops waiting after 4 seconds, and -w can change this maximum response time for each message send. And if the IP address is changed to 127.0.0.1 or other IP addresses with very short response times that respond immediately, then -w loses its effect because the waiting time for each send will not reach the maximum response time, and the delay will be shortened at this time. This method requires waiting a longer time. You can directly use -w to specify, but you need to subtract 500 milliseconds (the reason is not known), and the IP address must be an address that does not respond to requests. The program to wait for 2 seconds is as follows:
ping -n 2 -w 500 0.0.0.1>nul


echo Wscript.Sleep Wscript.Arguments(0) * 1000 >c:\delay.vbs
start /w c:\delay.vbs 15 --------------Create a 15-second delay
Floor 25 Posted 2007-03-06 03:59 ·  中国 浙江 宁波 象山县 电信
新手上路
Credits 7
Posts 3
Joined 2007-02-09 16:16
19-year member
UID 79066
Gender Male
Status Offline
New here, please take care of me
Floor 26 Posted 2007-03-06 05:54 ·  中国 江苏 苏州 电信
新手上路
Credits 7
Posts 4
Joined 2007-01-26 00:37
19-year member
UID 77676
Gender Male
Status Offline
Thanks
Floor 27 Posted 2007-03-06 07:01 ·  中国 四川 遂宁 电信
新手上路
Credits 8
Posts 4
Joined 2006-10-14 02:00
19-year member
UID 65669
Gender Female
Status Offline
Good stuff, hope to download! Thanks to the LZ for sharing!
Floor 28 Posted 2007-03-07 05:16 ·  中国 广东 广州 联通
初级用户
Credits 26
Posts 12
Joined 2006-09-24 20:29
19-year member
UID 63553
Status Offline
Hey, poor foundation, can't understand the 9th floor
Floor 29 Posted 2007-03-07 08:07 ·  中国 上海 电信
初级用户
Credits 25
Posts 12
Joined 2007-03-01 04:09
19-year member
UID 80443
Gender Male
Status Offline
ding ! Now I don't know what to do. I'll know later!!
Floor 30 Posted 2007-03-09 00:43 ·  中国 广西 钦州 电信
新手上路
Credits 2
Posts 1
Joined 2007-03-09 00:21
19-year member
UID 81118
Gender Male
Status Offline
Forum Jump: