开发者

Win 32, script, process all files in directory

开发者 https://www.devze.com 2023-03-25 21:50 出处:网络
I need to process all txt file in some folder using a console application. The command looks similar to this:

I need to process all txt file in some folder using a console application. The command looks similar to this:

convert input_开发者_如何学运维file.txt -par1 -par2 -par3

How to write a batch processing all files in the folder, passing file name as parameter to console apllication? Another idea, what about a Python solution?


Use for

for %f in (*.txt) do @convert "%f" -par1 -par2 -par3

Note that I use @ to suppress echoing of the command line at each iteration of the for loop. This is optional.

The above syntax is appropriate for use at the interactive console. When executing in a batch file, the %f must be replaced with %%f.

0

精彩评论

暂无评论...
验证码 换一张
取 消