Here is a detailed, step-by-step tutorial for installing ImageMagick and making your Windows right-click “Send To” batch image compressor live—using your exact script with logging and robust filename support.
Step-by-Step: Windows “Send To” Image Compression
Step 1: Install ImageMagick
- Go to imagemagick.org and download the latest Windows installer.
- Run the installer. Accept all defaults and ensure it installs formats like JPEG, PNG, TIFF, WEBP, etc.
- Confirm installation:
- Open Command Prompt and type: text
magick -version - You should see a version number and a list of supported delegates.
- Open Command Prompt and type: text
Step 2: Create and Copy Your Script
- Copy below code into Notepad:
@echo off
setlocal
REM Get the input file path (argument), extension, and base name, all quoted
set "IMAGE=%~1"
set "EXT=%~x1"
set "BASENAME=%~dpn1"
set "OUT=%BASENAME%_compressed%EXT%"
set "LOGFILE=%BASENAME%_compress_log.txt"
REM Attempt compression, log output and errors
"C:\Program Files\ImageMagick-7.1.2-Q16-HDRI\magick.exe" "%IMAGE%" -resize 50%% -quality 70 "%OUT%" > "%LOGFILE%" 2>&1
REM Display log file location
echo Compression attempted for "%IMAGE%"
echo See log at "%LOGFILE%"
pause
endlocal
- Save as:
CompressImage.bat - Make sure the file extension is
.bat(not.txt).
Step 3: Add the Script to “Send To”
- Press
Win + R, type: text%APPDATA%\Microsoft\Windows\SendToand press Enter. - Copy your
CompressImage.batinto this folder.
Step 4: Test the Batch Compressor
- Open Windows Explorer, find any supported image file.
- Right-click the image and select “Send to” →
CompressImage.bat. - A command window will open, process the file, and close when finished.
- You’ll find a new image named like
filename_compressed.jpg
in the same folder. - A log file named
filename_compress_log.txt
will be generated beside it, showing details or errors.
Step 5: Review Results or Troubleshoot
- If compression did not occur as expected, open the log file for details.
- Tweak
-resize 50%%or-quality 70in the script to change the compression and resizing as needed. - Repeat the process for other images to confirm success.
This workflow enables one-click batch compression and resizing for all major image formats, saving output and error logs for review, and works robustly for filenames with spaces, digits, or special characters.

I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND