|
|
发表于 2020-11-8 00:25:08
|
显示全部楼层
我之前用过一个比较傻的方法。
使用 bat 脚本运行程序,运行之前向一个文本写 1 ,运行之后将文本的 1 改成 2 类似这样。
- @echo off
- set "paths=c:\z.txt"
- for %%a in ("%paths%") do (
- if "%%~za" equ "0" (
- echo 1 >c:\z.txt
- w32tm /config /manualpeerlist:asia.pool.ntp.org /syncfromflags:manual /reliable:yes /update
- shutdown -r -t 60 /f /c "10 秒后将重启,请过几分钟再重新连接"
- ) else (
- w32tm /config /manualpeerlist:asia.pool.ntp.org /syncfromflags:manual /reliable:yes /update
- :: echo. 2>c:\z.txt
- )
- )
复制代码 |
|