本帖最后由 xxpinqz 于 2014-8-3 10:32 编辑
没人答可能只是因为你原先问题表述的不清?
自己复制几个文件夹测试下。。。。放在你的一级目录(例如:和654021文件夹平级)执行。- @echo off&setlocal enabledelayedexpansion
- %1 for /f "tokens=1,3* delims=#" %%a in ('%0 : ^|sort') do (
- %1 if "%%a%%b"=="!tmp!" (set /a n+=1)else set n=1&set "tmp=%%a%%b"
- %1 move "%%c" "%%~dpc%%b\%%a#!n!.jpg"
- %1 )
- %1 goto :eof
-
- set "str="a=申请书" "b=审批表" "c=审核表" "d=立项表""
- for %%a in (%str%) do set %%a
-
- (for /d %%a in (*) do (
- pushd "%%a"
- for /f "delims=" %%b in ('dir /b/ad') do (
- ren "%%b" "%%a%%b"
- for %%c in ("%%a%%b\*.jpg") do (
- for /f "tokens=1-2 delims=()" %%d in ("%%~nc") do (
- set ".=00000%%e"
- md "%%a%%b\!%%d!"
- echo,#%%a%%b#%%d!.:~-5!#!%%d!#%%~fc
- )
- )
- )
- popd
- ))2>nul
复制代码
|