Windows 10.0.18362 (build 18362)
Hi!
I'm currently working on bringing a script I wrote something like 10 years ago up to speed. Lets just say it's a bit of a mess so I'm hoping somebody has an idea on how to improve it.
The script is used to create index pages of a folder full of images that gets drag and dropped on the cmd file. While it still works, I want to improve it. One of the things that bugs me is that I would like each small picture to have just the name of the file under it without any extension. But I can't figure out how to do this.
Also, this one uses the old legacy apps and I would like to change that.
Here is my original script
Code: Select all
if "%~1" == "" goto error
rem Go to drag and drop folder
cd "%~1"
rem Get current dir name
for %%* in (.) do set CurrDirName=%%~n*
rem Count number of files in folder
for /f %%A in ('dir /a-d-s-h /b ^| find /v /c ""') do set cnt=%%A
echo File count = %cnt%
rem check if less or equal
if %cnt% leq 20 goto Small
rem check if less or equal
if %cnt% leq 30 goto Normal
rem check if greater than
if %cnt% geq 30 goto Big
:Small
echo small roll
Echo Creating thumbnails...
rem mogrify -format mpc -thumbnail 420 *.tif
mogrify -format mpc -thumbnail 620 *.jpg
Echo Creating index sheet...
montage -units PixelsPerInch -density 300 ^
-tile 4x5 -label %%f -font Arial -pointsize 6 -background "white" ^
-fill "black" -geometry 620x630+2+2 ^
-auto-orient *.mpc -title "%CurrDirName%" "##contact large.mpc"
convert "##contact large.mpc" -gravity north -background white -extent 2550x3300 "contact large.jpg"
goto end
:error
cls
echo Please drag and drop a folder on this script
echo Thank you
pause
exit
:end
rem echo Cleaning up workplace...
del *.mpc
del *.cache
exit
Thanks