I create many one-action .bat
files which accept drag-and-drop, and just pass an appropriate switch to main executable. The problem with .bat files is that I cannot reliably handle ANY name that was passed to me!
People complain that my programs not working because of funny names in paths or files. Most common examples contain characters like ()%!&
and very long names, etc.
I searched this issue and the answer is always escaping; but how in a world I would escape a string that comes to me by arguments, like %1
? So far I used short 8.3 names form, "%~s1"
, until it failed me too…
My question is, should I stop using Windows batch scripts? since I still have to program for XP, I don’t want to even look at PowerShell (or any dependences to Python or any other scripting language).