Getting command line to work in windows batch file.
Posted: 2014-02-01T09:15:25-07:00
I'm having trouble getting a convert command line to work in a windows .cmd file. The command line (sort of like -polaroid) works fine:
But the batch file creates the thumbnails directory, then dies without getting far enough to hit PAUSE:
I'm new to IM and despite hours of (very interesting) doc-trolling can't for the life of me find it. What silly obvious head-slapping thing am I missing?
PS: I also can't seem to get to drop the created files into the thumbnails subdirectory. Same issue?
Code: Select all
FOR %a in (*.jpg) DO convert %%a[800x] -set filename:fname %t -auto-orient -bordercolor grey60 -border 2 -bordercolor white -border 24 -bordercolor grey60 -border 2 -background none -wave 10x1600 -chop 0x10 -background black ( +clone -shadow 60x10+10+10 -rotate 180 ) +swap -background none -flatten -rotate 5 -resize 290x290 -unsharp 2x0.5+0.7+0 %[filename:fname]_thumb.png
Code: Select all
SETLOCAL EnableDelayedExpansion
%~d1
CD "%~p1"
MD thumbnails
FOR %%A in (*.jpg) DO (
FOR %a in (*.jpg) DO convert %%a[800x] -set filename:fname %%t -auto-orient -bordercolor grey60 -border 2 -bordercolor white -border 24 -bordercolor grey60 -border 2 -background none -wave 10x1600 -chop 0x10 -background black ( +clone -shadow 60x10+10+10 -rotate 180 ) +swap -background none -flatten -rotate 5 -resize 290x290 -unsharp 2x0.5+0.7+0 %%[filename:fname]_thumb.png
)
PAUSE
PS: I also can't seem to get
Code: Select all
thumbnails/%%[filename:fname]_thumb.png