本帖最后由 77七 于 2023-9-6 22:08 编辑
- md "%%a" & move "%%a.%%b" "%%a"
复制代码
- @echo off
- for /f "delims=" %%i in ('dir /b /a-d ^|find /v "%~nx0"') do (
- md "%%~ni" 2>nul
- move /-y "%%i" "%%~ni"
- )
复制代码
- @echo off
- for /f "delims=" %%i in ('dir /b /a-d ^|find /v "%~nx0"') do (
- if "%%~xi" equ "" (
- ren "%%i" "%%i.$"
- md "%%~ni" 2>nul
- move "%%i.$" "%%~ni\%%i"
- ) else (
- md "%%~ni" 2>nul
- move "%%i" "%%~ni"
- )
- )
复制代码
|