Another member has what seems to be a similar problem here;
Have a look at Edward ODaniel's reply. That may help you.
I'm trying to develop a batch script for getting photos off of an attached media card, into a directory in numerical order, with the directory being the current date. Each file would have that date and a three digit number (/6-7-08/6-7-08 000.jpg).
The only reason I am keeping it as a batch script is because it needs to be able to run with one file, one click and no installation. I'm a little out of my element (I tried writing a batch script in PHP syntax, it didn't work too well).
If you need anything else, let me know and I'll send it your way. Thanks in advance!