如果都是3层目录:- @echo off
- set file="1.txt"
- for /f "usebackq tokens=1-4 delims=\" %%a in (%file%) do (
- if not defined clear set clear= > %file%
- echo %%a\%%b\%%c %%d>> %file%
- )
复制代码 如果目录层数不相等:- @echo off
- set file="1.txt"
- for /f "usebackq delims=" %%a in (%file%) do (
- if not defined clear set clear= > %file%
- set var=%%~dpa?%%~nxa
- setlocal enabledelayedexpansion
- echo !var:\?= !>> %file%
- endlocal
- )
复制代码
[ 本帖最后由 tireless 于 2009-6-7 15:36 编辑 ] |