gpt4 book ai didi

batch-file - 批处理是否存在具有文件名的文件

转载 作者:行者123 更新时间:2023-12-04 23:30:00 24 4
gpt4 key购买 nike

情况是我使用 ffmpeg 将 m4a 转换为 mp3 文件。

现在我需要一个函数来检查文件 test.mp3 是否也在 test.m4a 文件夹中并删除 test.m4a。

谢谢您的帮助。

:start


for %%a in ("path\*.m4a") do ffmpeg -y -i "%%a" path\converted\%%~na.mp3"


timeout /T 10 > nul

goto start

最佳答案

哦,这应该工作:

:start


for %%a in ("path\*.m4a") do (
ffmpeg -y -i "%%a" path\converted\%%~na.mp3"
if exist %%a if exist %%~na.mp3 del %%a
)
timeout /T 10 > nul

goto start

关于batch-file - 批处理是否存在具有文件名的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20512865/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com