I have a bunch of files that I need to convert to a different file format using a program that is a standalone executable. You can either open the program and drag/drop the file on it that you want to convert or you can use the sendto command if I place the executable in the "sendto" directory in windows. The issue is there are a couple hundred files that I need to convert and if you drag / drop multiple files at one time or you send them using the "sendto" command it will only convert one of them and then stop. It appears that, while the program is actively converting a file, you have to wait for it to finish before it will accept the next file to convert.
我有一堆文件,我需要使用独立的可执行程序转换为不同的文件格式。您可以打开程序并拖放要转换的文件,或者如果我将可执行文件放在Windows的“sendto”目录中,则可以使用sendto命令。问题是我需要转换几百个文件,如果您一次拖放多个文件或者使用“sendto”命令发送它们,它只会转换其中一个然后停止。看来,当程序正在主动转换文件时,您必须等待它完成才能接受下一个要转换的文件。
I am looking for a way (preferably a batch file but, if necessary, a script) that will send a file to be converted and then wait a predetermined period of time before sending the next file for conversion. Ideally this program could search sub folders for the files that need to be converted.
我正在寻找一种方法(最好是一个批处理文件,但如果需要,一个脚本),它将发送一个要转换的文件,然后在发送下一个转换文件之前等待一段预定的时间。理想情况下,此程序可以在子文件夹中搜索需要转换的文件。
Ex.
Search *.cue in sub folders
在子文件夹中搜索* .cue
Sendto program.exe
Wait 3 minutes before sending the next file from the search above
等待3分钟,然后从上面的搜索发送下一个文件
I'm not sure if the above is possible. Would it make more sense to drag/drop multiple files in need of conversion on a batch file that would run a routine to accomplish the above?
我不确定上述是否可行。将一个需要转换的多个文件拖放到批处理文件上会更有意义吗,该批处理文件将运行例程来完成上述操作?
Is it possible with a batch file?
是否可以使用批处理文件?
Thank you for your time!
感谢您的时间!
2 个解决方案
#1
1
for /R %%a in (*.cue) do (
Start cue2ccd.exe "%%~fa"
timeout /t 45
TASKKILL /F /IM cue2*
)
#2
0
Use a simple for
loop to process each file individually:
使用简单的for循环分别处理每个文件:
for %%a in (*.cue) do (
program.exe "%%~fa"
timeout /t 180
)
You can try to replace program.exe "%%~fa"
with start /wait program.exe "%%~fa"
and delete the timeout
command. (start /wait
is supposed to pause the script until the started program exits; for some GUI-programms that works, for some it doesn't.)
您可以尝试将program.exe“%% ~fa”替换为start / wait program.exe“%% ~fa”并删除timeout命令。 (启动/等待应该暂停脚本,直到启动的程序退出;对于一些有效的GUI程序,对某些程序来说不行。)
#1
1
for /R %%a in (*.cue) do (
Start cue2ccd.exe "%%~fa"
timeout /t 45
TASKKILL /F /IM cue2*
)
#2
0
Use a simple for
loop to process each file individually:
使用简单的for循环分别处理每个文件:
for %%a in (*.cue) do (
program.exe "%%~fa"
timeout /t 180
)
You can try to replace program.exe "%%~fa"
with start /wait program.exe "%%~fa"
and delete the timeout
command. (start /wait
is supposed to pause the script until the started program exits; for some GUI-programms that works, for some it doesn't.)
您可以尝试将program.exe“%% ~fa”替换为start / wait program.exe“%% ~fa”并删除timeout命令。 (启动/等待应该暂停脚本,直到启动的程序退出;对于一些有效的GUI程序,对某些程序来说不行。)