Skip to content

Commit 8c07085

Browse files
authored
Update and rename Time.bat to UpdateTime.bat
Signed-off-by: 陈仁儿 <[email protected]>
1 parent 8dceffd commit 8c07085

File tree

2 files changed

+31
-14
lines changed

2 files changed

+31
-14
lines changed

src/Time.bat

-14
This file was deleted.

src/UpdateTime.bat

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@echo off
2+
SETLOCAL EnableDelayedExpansion
3+
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
4+
set "DEL=%%a"
5+
)
6+
rem echo say the name of the colors, don't read
7+
:start
8+
rem cls
9+
10+
call :ColorText 0e "同步开始"
11+
echo.
12+
net stop w32time
13+
net start w32time
14+
w32tm /config /manualpeerlist:"time.nist.gov" /syncfromflags:manual /reliable:yes /update
15+
w32tm /resync
16+
w32tm /resync
17+
w32tm /config /manualpeerlist:"time.windows.com" /syncfromflags:manual /reliable:yes /update
18+
w32tm /resync
19+
w32tm /resync
20+
call :ColorText 0e "同步结束"
21+
echo.
22+
pause
23+
24+
goto :eof
25+
26+
:ColorText
27+
echo off
28+
<nul set /p ".=%DEL%" > "%~2"
29+
findstr /v /a:%1 /R "^$" "%~2" nul
30+
del "%~2" > nul 2>&1
31+
goto :eof

0 commit comments

Comments
 (0)