running more than one command line commands inside for loop

Posted by klijo on Super User See other posts from Super User or by klijo
Published on 2012-04-07T16:46:15Z Indexed on 2012/04/07 17:35 UTC
Read the original article Hit count: 220

Filed under:
|
|

i have a folder containing images and i want to determine its Compression method used. So i would loop through the folder and do a grep Compression like this

and note i have installed grep for windows

for %f in (*.jpg) do  identify -verbose "%f" | grep Compression >> info.txt

However i need to write the file name and compression technique used so i modified the above command

for %f in (*.jpg) do  identify -verbose "%f" | grep Compression & echo "%f" & echo: >> info.txt

But the problem is that i get a blank txt file. Could someone pleas help me.

© Super User or respective owner

Related posts about Windows

Related posts about command-line