中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-11-24 07:42
47,820 topics / 349,938 posts / today 0 new / 48,298 members
DOS批处理 & 脚本技术(批处理室) » [Help] Want to use batch processing to achieve time calibration
Printable Version  2,983 / 24
Floor16 exzzz Posted 2008-12-12 11:17
初级用户 Posts 167 Credits 194
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!
Floor17 yishanju Posted 2008-12-12 11:19
银牌会员 Posts 1,357 Credits 1,488
...I didn't test it in batch processing.
End
Floor18 yishanju Posted 2008-12-12 11:21
银牌会员 Posts 1,357 Credits 1,488
It seems that a delay is needed.
Floor19 yishanju Posted 2008-12-12 11:22
银牌会员 Posts 1,357 Credits 1,488
You need to add a delay to make it work.
Floor20 wangff Posted 2008-12-12 15:10
初级用户 Posts 54 Credits 134
Fellow brothers, still no countermeasures?
Floor21 qzwqzw Posted 2008-12-12 16:51
银牌会员 Posts 636 Credits 2,343
```
@echo off
start /b telnet -f time.log stdtime.gov.hk 13
ping -n 2 127.1>nul
taskkill /fi "windowtitle eq Telnet*"
```
Floor22 yishanju Posted 2008-12-12 17:18
银牌会员 Posts 1,357 Credits 1,488
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.
Floor23 qzwqzw Posted 2008-12-12 18:15
银牌会员 Posts 636 Credits 2,343
Generally use
net time /sntp:time server address
net time /set
Floor24 yishanju Posted 2008-12-12 18:50
银牌会员 Posts 1,357 Credits 1,488
w32tm
Interested to study and have a look
Floor25 wangff Posted 2008-12-14 22:25
初级用户 Posts 54 Credits 134
```
@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
```
Prev  1 2
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023