我正在创建这个与handbrakecli一起使用的批处理文件,将avi批量转换为mp4.
但是我陷入了如何继续循环并跳过循环中的当前文件.
FOR /R "%somepath%" %%G in (*.avi) DO (
rem skip if filename contains word trailer
rem skip if file name contains word sample
rem do conversion
)
Run Code Online (Sandbox Code Playgroud)
这当前不能跳过包含预告片或示例的文件
我尝试过使用find或findstr,但都无法跳过.
echo "%%G" | c:\windows\system32\findstr /i "trailer" > NUL
If %ERRORLEVEL% EQU 1 set skip Yes
Run Code Online (Sandbox Code Playgroud)
这是样品.
echo "%%G" | c:\windows\system32\findstr /i "sample" > NUL
If %ERRORLEVEL% EQU 1 set skip Yes
Run Code Online (Sandbox Code Playgroud)
如果文件包含预告片或样本,我不想进行任何handbrakecli转换,只是跳过它.
我做echo来显示哪些文件被转换,它确实包含名称中包含Sample或sample的文件.
我尝试过使用find或findstr,但都没有将skip设置为yes
如果跳过==不做(rem做转换)
我只想转换非预告片/样本avi文件.
感谢您的时间.