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-07-29 18:41
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] Want to use batch processing to achieve time calibration View 2,346 Replies 24
Floor 16 Posted 2008-12-12 11:17 ·  中国 广东 深圳 电信
初级用户
★★
游手好闲 + 无所事事 ..
Credits 194
Posts 167
Joined 2007-04-30 09:43
19-year member
UID 87022
Gender Male
Status Offline
Spit out blood, the person upstairs, you try it yourself.
START telnet stdtime.gov.hk 13 -f c:\test.txt
After that, there is a black telnet window hanging there, and you must click the mouse or press a key to make it disappear. The test.txt will have content only after the window disappears, and full automation cannot be achieved!
Floor 17 Posted 2008-12-12 11:19 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
...I didn't test it in batch processing.
End

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 18 Posted 2008-12-12 11:21 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
It seems that a delay is needed.

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 19 Posted 2008-12-12 11:22 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
You need to add a delay to make it work.

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 20 Posted 2008-12-12 15:10 ·  中国 福建 泉州 移动
初级用户
★★
Credits 134
Posts 54
Joined 2008-11-19 11:47
17-year member
UID 131429
Gender Male
Status Offline
Fellow brothers, still no countermeasures?
Floor 21 Posted 2008-12-12 16:51 ·  中国 山西 电信
银牌会员
★★★
天的白色影子
Credits 2,343
Posts 636
Joined 2004-03-06 00:00
22-year member
UID 19350
Gender Male
Status Offline
```
@echo off
start /b telnet -f time.log stdtime.gov.hk 13
ping -n 2 127.1>nul
taskkill /fi "windowtitle eq Telnet*"
```
Floor 22 Posted 2008-12-12 17:18 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
I think the original author should be able to complete the final code by themselves. But because a delay was added after TELNET, the time precision obtained has decreased.

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 23 Posted 2008-12-12 18:15 ·  中国 山西 电信
银牌会员
★★★
天的白色影子
Credits 2,343
Posts 636
Joined 2004-03-06 00:00
22-year member
UID 19350
Gender Male
Status Offline
Generally use
net time /sntp:time server address
net time /set
Floor 24 Posted 2008-12-12 18:50 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
w32tm
Interested to study and have a look

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 25 Posted 2008-12-14 22:25 ·  中国 福建 泉州 电信
初级用户
★★
Credits 134
Posts 54
Joined 2008-11-19 11:47
17-year member
UID 131429
Gender Male
Status Offline
```
@echo off
:loop
start /b telnet -f time.log stdtime.gov.hk 13
ping -n 2 127.1>nul
set/p aa=<time.log
for /f "tokens=4" %%i in ("%aa%") do set aa=%%i
cls&time %aa%
echo time %aa%
ping -n 6 127.1>nul
(
echo e100 B9 61 1E B4 05 CD 16 CD 20
echo rcx
echo 9
echo nn.com
echo w
echo q
)>123.txt
debug<123.txt >nul
n
goto loop
```
Forum Jump: