A simple Windows .cmd script that converts an image from one format to another — no third-party software required. It uses PowerShell and the built-in .NET System.Drawing library, both of which ship with Windows.
- Prompts you for an image path (you can also drag and drop the file into the console window)
- Prompts you for the target format
- Converts the image and saves it next to the original file
- No installation, no dependencies, no internet connection needed
Input: any format supported by System.Drawing (jpg, png, bmp, gif, tiff, and most common raster formats)
Output:
jpg/jpegpngbmpgiftiff/tifico
- svg — SVG is a vector format, not a raster format. Converting a raster image (jpg, png, etc.) to SVG requires vectorization/tracing, which is a fundamentally different (and much more complex) process than a simple format conversion. Windows has no built-in tool for this. If you need SVG output, use a dedicated tool such as Inkscape (free) or Potrace.
convert-image.cmd— the script you runconvert-image.ps1— does the actual conversion (must stay in the same folder as the.cmdfile)
- Download both
convert-image.cmdandconvert-image.ps1and keep them in the same folder. - Double-click
convert-image.cmdto run it. - Enter the path to your image (or drag and drop the image file into the console window and press Enter).
- Enter the desired output format (e.g.
png). - The converted file is created in the same folder as the original, and that folder opens automatically with the new file selected.
- Press
Cto convert another image, orXto exit.
If you see an error like execution of scripts is disabled on this system, your PowerShell execution policy is blocking the script. The .cmd file already runs PowerShell with -ExecutionPolicy Bypass, which should avoid this in most cases. If it still happens, open PowerShell as Administrator and run:
Set-ExecutionPolicy -Scope CurrentUser RemoteSignedEnter the image file path: C:\Users\me\Pictures\photo.jpg
Enter the target format: png
Converting...
Conversion completed successfully.
Output file: C:\Users\me\Pictures\photo.png
Converting to .ico produces a proper multi-resolution icon containing four standard sizes (16x16, 32x32, 48x48, 256x256), each embedded as PNG data (the modern ICO format supported since Windows Vista). The source image is automatically fitted into each square canvas while preserving its aspect ratio and transparency.
Earlier versions of this script used .NET's Bitmap.GetHicon(), which has a known bug that produces corrupted .ico files for non-standard image dimensions. This has been fixed by building the ICO file manually.
- Windows with PowerShell available (included by default on Windows 7 and later)
- No admin rights or installation needed
Current version: 1.0.0 (see CHANGELOG.md for release history)
Download the latest release from the Releases page.
Usef Farahmand GitHub: https://github.com/UsefFarahmand
MIT — feel free to use, modify, and share.