Windows – Batch command for ImageMagick to convert all files in a directory and sub-directories on windows

batch-fileimagemagickimagemagick-convertsvgwindows

I have thousands of SVG's in a folder and sub-folders. What I want is to batch convert all of them to jpg or png images.

Can someone help me write a command for ImageMagick (windows), which can find and convert all the svg's to jpg/png with their original names and keep them in the same directories?

Here is the example structure:

C:\SVG\BusinessMan.svg
C:\SVG\Models\Home.svg
C:\SVG\Underlines\underline.svg

And I want it like this after conversion:

C:\SVG\BusinessMan.svg
C:\SVG\BusinessMan.jpg
C:\SVG\Models\Home.svg
C:\SVG\Models\Home.jpg
C:\SVG\Underlines\underline.svg
C:\SVG\Underlines\underline.jpg

Best Answer

you don't need shell scripting just use the mogrify command

cd to your image directory

mogrify -format png *.svg