Multithreaded Windows FOR batch command

Posted by Axarydax on Super User See other posts from Super User or by Axarydax
Published on 2011-01-12T12:55:00Z Indexed on 2011/01/12 13:56 UTC
Read the original article Hit count: 234

Filed under:
|

Hi, do you know if there is a simple way to run FOR command in batch file on multiple threads? What's the point of having 4 cores if I can't run my tasks in 4 parallel threads?

For example, if I am optimizing PNGs with PNGOUT, the command I would use is

for %i in (*.png) do pngout "%i"

But this is highly paralellizable task in which the sub-tasks do not depend on each other at all.

To run this in 4 'queues' I'd write something like

for -thread 4 %i in (*.png) do pngout "%i"

Do I need to write my own for-like app that would be able to do this or is there available free solution?

© Super User or respective owner

Related posts about batch

Related posts about automation