pinghoo 当前离线
列兵
cmd1152 当前离线
禁止访问
TOP
zaqmlp 当前离线
上尉
@echo off&mode con lines=15 cols=50&cd /d "%~dp0" set "inifile=D:\xxx\config.ini" if not exist "%inifile%" (echo;"%inifile%" 未找到&pause&exit) set "h=#" :loop title %time% for /f "delims=:" %%a in ("%time%") do set hour=%%a set "hour=00%hour: =%" set /a "hour=1%hour:~-2% - 100" if "%hour%" equ "23" (set hour2=0) else (set /a hour2=hour+1) if "%hour%" neq "%h%" ( cls&echo;%time% --^> [%hour2%] set "h=%hour%" call :change echo;monitoring…… ) >nul ping /n 2 0 goto loop pause exit :change for /f "delims=[]" %%a in ('type "%inifile%"^|find /n "edit_dszdqxjy_hour="') do set "line=%%a" (for /f "tokens=1* delims=:" %%a in ('type "%inifile%"^|findstr /n .*') do ( if "%%a" neq "%line%" ( echo;%%b ) else echo;edit_dszdqxjy_hour=%hour2% ))>t.t move /y t.t "%inifile%" pause exit复制代码
@echo off setlocal enabledelayedexpansion :i echo;[main]>config.ini set sz=!time:~0,2!+1 if "%sz%"=="24" (set sz=0) echo;edit_dszdqxjy_hour=%sz%>>config.ini echo;edit_dszdqxjy_min=6>>config.ini ping -n 4 127.1>nul goto :i复制代码