I'm trying to make a very simple .bat using imagemagick to make icons that you can just drag and drop any image onto the .bat to run it. small example is
convert "%~1" -resize 256x256^^! "%~n1".ico
%~1
to take the full file and path dropped on and %~n1
to get that filename and use it for the .ico it ouputs.
Since any file can be dragged on to do it, how would i deal with wild filenames that have characters that need escaping in them, like if some monster dragged in a file named ^%!!test test,0,5$5%.jpg
it really messes it up. Is this just something thats a part of .bat life and unavoidable or can i preemptive strike and escape everything you could throw at it?
My eventual goal is to batch convert lots of random files so filenames may have any possibilities.