- @echo off
- setlocal enabledelayedexpansion
- (for /f "delims=" %%a in ('findstr "Date: ID:" d:\log.txt') do (
- set "str1=%%a"
- if not "!str1:6006=!"=="!str1!" (
- set "var=开机!str2!
- ) else if not "!str1:6005=!"=="!str1!" (
- echo !var! ----关机!str2!
- )
- set "str2=%%a"
- set "str2=!str2:*Date=!"
- ))>d:\DD.txt
- pause
复制代码
|