- @echo off
- @rem 保存为ANSI格式
- setlocal enabledelayedexpansion
- set "Previous_Folder=%ComSpec%"
- for /f "delims=" %%a in ('dir/b/s/ad^|sort') do (
- set "Current_folder=%%a"
- call set "dif_str=%%Current_folder:!Previous_Folder!=%%
- if "!dif_str!" neq "%%a" (
- move /y "!Previous_Folder!\*.*" "%%~a\" >nul 2>&1
- rd /q /s "!Previous_Folder!" >nul 2>&1
- )
- set "Previous_Folder=!Current_folder!"
- )
复制代码
|