
大神幫忙批處理重命名文件語句差錯
運行批處理后文件名不正常,有按照A.txt---B.txt去改但是有重名文件求大神幫忙解決,萬分感謝nclick="copycode($('code0'));">復制代碼
- @echo on
- set alist=A.txt
- set blist=B.txt
- for %%a in (D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
- if exist %%a:*.* (
- for %%b in (0 1 2 3 4 5 6 7 8 9) do (
- if exist %%a:song%%b*.* (
- for /f tokens=1,2,3,4,5,6* delims= %%c in (alist.txt) do (
- if exist %%a:song%%b%%c.* (
- for /f tokens=1,2,3,4,5,6* delims= %%d in (blist.txt) do (
- if exist %%a:song%%b%%c.* ren %%a:song%%b%%c.* %%d.*
- )
- )
- )
- )
- )
- )
- )
- @echo on
- pause

