问题描述
我使用的是一个名为metaflac的CLI程序()来删除我计算机上各种FLAC音乐文件的填充。在批处理文件中使用以下命令(使用同一文件夹中的metaflac.exe)可以为单个文件成功完成此任务:
I am using a CLI program called metaflac (http://flac.sourceforge.net/documentation_tools_metaflac.html) to remove padding from various FLAC music files on my computer. Using the following command in a batch file (with metaflac.exe in the same folder) successfully completes this task for an individual file:
metaflac --dont-use-padding --remove --block-type = PADDINGfilename.flac
metaflac --dont-use-padding --remove --block-type=PADDING "filename.flac"
我必须这样做几千个文件,不想手动/个别。有没有一个简单的方法,我只需将这个命令指向一个目录,并对其中的每个文件执行操作?这将节省我很多时间。
I have to do this for several thousand files and don't want to do it all manually/individually. Is there an easy way for me to simply direct this command to a directory and have it act upon every file in there? This would save me a lot of time.
谢谢!
我正在使用Windows 7 64位。
I am using Windows 7 64-bit.
推荐答案
当然可以。您可以使用 cmd
提示中的单行执行。
Sure. You can do it with a one-liner from a cmd
prompt.
for /f "delims=" %I in ('dir /s /b *.flac') do metaflac --dont-use-padding --remove --block-type=PADDING "%I"
如果您将其放入 .bat
脚本中,在两个地方将%I
更改为 %% I
。
If you're putting this into a .bat
script, change %I
to %%I
in both places.
这篇关于在多个音乐文件上运行命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!