原來第一行就是呀
我竟然忽略了~~~~傻眼
wusun wrote:
試試:RarFixe...(恕刪)
wusun wrote:
試試:RarFixe...(恕刪)
wusun wrote:
試試:RarFixe...(恕刪)
天空一片雲 wrote:
我知道您這bat的RAR檔名是依照 壓縮數量命名的
我想請問可否改成檔名來命名
就是抓第一個跟第N個的檔名來命名
...(恕刪)
| @echo off setlocal EnableDelayedExpansion set RarPassword=Your Password set RarTargetFolder=C:\AAA set /a Rar_Pack_Size=100 set RarCommand=C:\Program Files\WinRAR\Rar.exe set TempList=%temp%\RarCount.lst set /a File_Count=0 if EXIST "%TempList%" del "%TempList%" for /f "delims=" %%i in ('dir /a:-d /o:n /b /s "%RarTargetFolder%\*.*"') do ( echo %%i>>"%TempList%" set /a File_Count+=1 set EachFileName=%%~ni if !File_Count!==1 set RarFileName=!EachFileName! if !File_Count!==%Rar_Pack_Size% ( set RarFileName=!RarFileName!_!EachFileName!.rar "%RarCommand%" a -p"%RarPassword%" "!RarFileName!" @"%TempList%" set /a File_Count=0 del "%TempList%" ) ) ::處理剩下的檔 if !File_Count! NEQ 0 ( set RarFileName=!RarFileName!_!EachFileName!.rar "%RarCommand%" a -p"%RarPassword%" "!RarFileName!" @"%TempList%" set /a File_Count=0 del "%TempList%" ) pause |