0
確かにこれは明らかですが何らかの理由で、 :名前を変更します。誰かが私にここの問題が何であるか教えてもらえますか?これは、2つの他の質問に関連している - ここでLooking for a way to execute a batch file once a folder hits 10 filesとcopy and rename files of a certain extension via batch fileバッチファイルが2回実行されている理由を把握しようとしています
は、バッチファイル--->
rem Counting files...
set /a count = 0
for /f "tokens=*" %%P IN ('dir "H:\" /A /b') do (set /a count += 1)
rem 5 or more files?
if %count% GEQ 5 call :rename
:rename
SET count=1
FOR /f "tokens=*" %%G IN ('dir /b *.jpg') DO (call :rename_next "%%G")
goto:copy
:rename_next
ren "%1" %count%.jpg
Pause
set /a count+=1
goto:eof
:copy
xcopy c:\photo\*.jpg c:\photo\files /Y
Pause
が働いたとセンスを作ったこと、ありがとうございました。私は外出するためにgoto:eofを追加しました。 – samsam