|
在您及神的马甲的指点下,因还要取满10行退出,我将其调整为:
@echo off & setlocal enabledelayedexpansion
set "file=%~dp0info_vhd_sys_old.flg"
if not exist %file% goto :nofile
set maxosno=10 & set n=0
for /f "usebackq tokens=1-7 eol= delims= " %%a in ("%file%") do (
set "str=%%a"
if "!str:~,1!" == ";" (goto :Next) else (
if !n! lss %maxosno% (
set /a n+=1
set "vname!n!=%%a" & set "vdsk!n!=%%b" & set "vdir!n!=%%c"
set "monvhd!n!=%%d" & set "subvhd!n!=%%e"
set "bakvhd!n!=%%f" & set "tmpvhd=%%g"
for %%i in (NO No nO no) do if "!tmpvhd!"=="%%i" set "tmpvhd="
set "tmpvhd!n!=!tmpvhd!"
) else (goto :Next)
)
)
:Next
for %%a in (vname vdsk vdir monvhd subvhd bakvhd tmpvhd) do (
for /l %%b in (1 1 %n%) do echo,%%a%%b=!%%a%%b!
echo,
)
pause
goto end
:nofile
echo. & echo.未找到信息文件,按任一键退出.... & echo. & pause
goto end
:end
|
|