本帖最后由 pcl_test 于 2015-3-14 22:01 编辑
回复 3# honghong33 - @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%a in ('dir /ad /b') do (
- set n=0
- pushd "%%a\"
- for /f "delims=" %%a in ('dir /a-d /b 2^>nul') do set /a n+=1
- popd
- if !n! == 0 (
- rd "%%a\" /q
- ) else (
- set name=0000!n!
- set name=!name:~-5!
- if not exist "结果\!name!\" md "结果\!name!\"
- move "%%a" "结果\!name!\"
- )
- )
- pause
复制代码
|