@echo off Title convert_oldgrub_grub4dos_rev2.bat REM updated 10/22/2014 REM Place this batch file anywhere and drag and drop the image files (bmp, REM jpg or png) to be converted on it (other image formats may not convert REM correctly). Converted files will be moved to the same directory as this file. REM Drag and drop single or multiple 640x480 (or with the same aspect ratio) REM .png or .bmp images into this batch file to convert them to Grub and REM Grub4Dos compatible splash images with ImageMagick. The converted REM file(s) will have "_splash" appended after the name and the REM extension(s) changed to xpm.gz. This script works for files only (it will REM not work for folders). Tested on Vista and WinXP with ImageMagick portable REM installed to C:\Utilities folder. REM CD "%~dp0" changes the working directory to the current directory (where REM this batch file is located) REM "%~n1" is the file name minus the extension CD "%~dp0" set cdir=%~dp0% echo. echo Current directory is: "%~dp0" echo. :Loop IF [%1]==[] goto continue F:\Utilities\ImageMagick\convert -resize 640x480 -colors 14 %1 ^ "%~n1_splash.xpm.gz" move "%~n1_splash.xpm.gz" "%cdir%" echo "%~nx1 converted to xpm.gz" echo "converted image moved to:" echo "%cdir%" echo. SHIFT goto Loop :continue echo. echo "All conversions completed...." echo. @pause REM --------------------------- exit ----------------------------------------- :end EXIT /B 0