本帖最后由 77七 于 2024-9-5 12:10 编辑
上传图片可以用图床
- @echo off
- rem 保存为ansi
- cd /d "%~dp0"
- for %%a in ("目录" "村级" "户级") do (
- set _"%%~a"=1
- )
- for /d %%d in (*) do (
- if not defined _"%%d" (
- set str=%%d
- call :1 "%%d"
- )
- )
- pause
- exit
-
- :1
- for /d %%d in ("%~1\*") do (
- set str=%str%%%~nxd
- if defined _"%%~nxd" (
- robocopy "%%~dpd目录" "目录\%str%目录" /e /move
- robocopy "%%~dpd村级" "%%~dpd\" /e /move
- robocopy "%%~dpd户级" "%%~dpd\" /e /move
- exit /b
- ) else (
- call :1 "%%d"
- )
- )
- exit /b
复制代码
|