回复 10# jyc19970330
添加:- @echo off
-
- setlocal disabledelayedexpansion
-
- set file="..\1.ini"
-
- set []=#
- set #clear=#
- for /f "delims=" %%a in ('findstr /n .* %file%') do (
- if defined #clear set "#clear=" >%file%
- set var=%%a$
- setlocal enabledelayedexpansion
- set var=!var:*:=!
- (
- if /i "![]!!var:~0,2!" == "[CCC]真=" (
- echo 真=True
- echo 路径=!cd!
- echo 文件=Xxx
- ) else (
- echo,!var:~0,-1!
- if "!var:~0,1!!var:~-2,-1!" == "[]" (
- for %%a in ("!var:~0,-1!") do (
- endlocal
- set []=%%~a
- )
- ) else (
- endlocal
- )
- )
- ) >>%file%
- )
-
- pause
复制代码 删除:- @echo off
-
- setlocal disabledelayedexpansion
-
- set file="..\1.ini"
-
- set []=#
- set #clear=#
- for /f "delims=" %%a in ('findstr /n .* %file%') do (
- if defined #clear set "#clear=" >%file%
- set var=%%a$
- setlocal enabledelayedexpansion
- set var=!var:*:=!
- (
- if /i "![]!!var:~0,2!" == "[CCC]真=" (
- echo 真=false
- ) else (
- if /i "!![]!!var:~0,3!" neq "[CCC]路径=" (
- if /i "!![]!!var:~0,3!" neq "[CCC]文件=" (
- echo,!var:~0,-1!
- if "!var:~0,1!!var:~-2,-1!" == "[]" (
- for %%a in ("!var:~0,-1!") do (
- endlocal
- set []=%%~a
- )
- ) else (
- endlocal
- )
- )
- )
- )
- ) >>%file%
- )
-
- pause
复制代码
|