本帖最后由 77七 于 2023-7-2 07:37 编辑
- @echo off
- ::第7行
- setlocal enabledelayedexpansion
- ::第11-15行
- for /f "useback tokens=1-3 delims=;" %%a in ("%cd%\config.ldt") do (
- set color=%%c
- if "%%a" equ "true" (
- set dbgx=a
- ) else if "%%a" equ "false" (
- set dbgx=b
- ) else (
- goto :configerr
- )
- rem ...
- )
- ::第16行
- echo %color%|findstr /rbec:"[0-9a-f][0-9a-f]" |findstr /ivc:"%color:~0,1%%color:~0,1%" 1>nul && (
- goto :colok
- ) || (
- goto :configerr
- )
-
- ::第18-41行,不会被执行
- ::第52-53行
- if "%com%" equ "shutdown" (
- set /p shutyn=Shutdown now?[Y/N]:
- if /i "!shutyn!" equ "y" (
- shutdown /s /t 0 /f
- )
- )
-
- ::后续未修改
-
- ::耗时部分
- set "t=%time%"
- rem ...
- set "t1=%time%"
- call :c
-
- set "t=%time%"
- rem ...
- set "t1=%time%"
- call :c
-
- ::这段放代码 exit 命令之后
- :c
- if "%t1:~,2%" lss "%t:~,2%" set "add=+24"
- set /a "times=(%t1:~,2%-%t:~,2%%add%)*360000+(1%t1:~3,2%%%100-1%t:~3,2%%%100)*6000+(1%t1:~6,2%%%100-1%t:~6,2%%%100)*100+(1%t1:~-2%%%100-1%t:~-2%%%100)"
- echo 检索时间 %times% ms
- exit /b
复制代码 根据我的经验和习惯改的,有些地方改的可能不正确。 |