本帖最后由 sdhaozao 于 2015-2-11 13:47 编辑
最终解决方案,虽然看起来很愚蠢,作为新手我尽力了, 有大神愿意帮助精简代码最好了。- @echo off
- cd /d "D:\New\"
- for /f "delims=" %%a in ('dir /s/b "FIT-UP REPORT.pdf"') do (
- ren "%%a" "01-%%~nxa"
- )
- for /f "delims=" %%a in ('dir /s/b "WELD VISUAL INSPECTION REPORT.pdf"') do (
- ren "%%a" "02-%%~nxa"
- )
- for /f "delims=" %%a in ('dir /s/b "STRUCTURAL DEMENSIONAL REPORT AW.pdf"') do (
- ren "%%a" "03-%%~nxa"
- )
- for /f "delims=" %%a in ('dir /s/b "STRUCTURAL DIMENSIONAL INSPECTION REPORT BW.pdf"') do (
- ren "%%a" "03-%%~nxa"
- )
- for /f "delims=" %%a in ('dir /s/b "STAGE RELEASE NOTICE_Part1.pdf"') do (
- ren "%%a" "04-%%~nxa"
- )
- for /f "delims=" %%a in ('dir /s/b "MAGNETIC PARTICLE EXAMINATION REPORT.pdf"') do (
- ren "%%a" "05-%%~nxa"
- )
- for /f "delims=" %%a in ('dir /s/b "STAGE RELEASE NOTICE_Part2.pdf"') do (
- ren "%%a" "05-%%~nxa"
- )
- pause
复制代码
|