Win 32, script, process all files in directory
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
.
精彩评论