备份好源文件,以免发生意外:- @echo off
- setlocal enabledelayedexpansion
- md temp
- for /f "delims=" %%i in ('dir /s /ad /b 目录') do (
- set "DI=%%i"
- set "DI=!DI:*%cd%=!"
- set "DI=temp\!DI:\=!\"
- md "!DI!"
- move "%%i\*.*" "!DI!"
- rd "%%i"
- )
- ren temp 目录
- for /f "delims=" %%i in ('dir /s /ad /b 村级 户级') do (
- move "%%i\*.*" "%%i\.."
- rd "%%i"
- )
- pause
复制代码
|