回复 1# czvde
未测试- @echo off
- setlocal enabledelayedexpansion
- for /f "tokens=1,2 delims=_" %%i in ('dir /b /a-d') do (
- if defined %%i%%j (
- if !m!==0 (
- set /a n+=1
- set str!n!=%%i_%%j
- )
- set m=1
- ) else (
- set m=0
- set %%i%%j=true
- )
- )
- for /l %%a in (1,1,!n!) do (
- if not exist !str%%a:~,2! md !str%%a:~,2!
- move "!str%%a!*.*" "!str%%a:~,2!"
- )
- dir /b /a-d>未移动文件的文件名说明.txt
- pause
复制代码
|