Home » Image conversion » Convert JPEG/JPG » Batch convert JPG/JPEG to PNG

Batch convert JPG/JPEG to PNG

With this command line script you can batch convert all JPG/JPEG-images to .PNG. We will show you how to convert .jpg-files by right clicking on a folder. All the jpg-images will then be converted to png and saved in a sub folder (named ´png´). This tutorial will show you how to create a batch file with Irfanview command line commands and how to create a registry file to create an extra option in the context menu for converting jpg-files with one mouse click!

First, you have to download and install Irfanview (freeware) on your computer.  Just choose the standard options, install paths etc.

1. Create a batch file (name it "convertjpg-png.bat") using notepad.

This is what the batch file should look like:


cd %1
md png
move /y *.png* png\
for %%n in (jpg) do "%ProgramFiles%\IrfanView\i_view32.exe" *.%%n /convert=*.png /silent %1
move /y *.png* png\

2. Save this batch file as convertjpg-png.bat and copy it to the C:\Windows directory.

3. Create a .reg file (name it convertjpg-png.reg) using notepad.

This is what the reg-file should look like:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\convert_to_png]
@="Convert all jpg images to png"

[HKEY_CLASSES_ROOT\Folder\shell\convert_to_png\command]
@="C:\\WINDOWS\\convertjpg-png.bat \"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\convert_to_png]
@="Convert all jpg images to png"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\convert_to_png\command]
@="C:\\WINDOWS\\convertjpg-png.bat \"%1\""


4. Save the file as convertjpg-png.reg.

5. Double click the convertjpg-png.reg file to add the registry file to your Windows registry.

6. Now, when you right click a folder that contains jpg-files, the context menu will show an extra option: "Convert all jpg images to png". If you select this option, all the jpg-files will be converted to png and saved in a sub folder (named png).