举个栗子- @echo off&setlocal enabledelayedexpansion
- set optimal=正常
- set uptimal=不正常
- for /f "tokens=1-3 delims=_: " %%i in ('more +13 "%~f0"') do (
- if /i "%%k"=="Optimal" set /a n+=1
- set "#%%i=%%k"
- )
- if "%n%" equ "2" (
- echo;RAID卡一切正常
- ) else (
- for /f "tokens=1,2 delims=#=" %%i in ('set #') do echo;%%i!%%j!
- )
- pause&exit
- RAID1_State : Optimal
- RAID10_State : Optimal
复制代码
|