I'm not sure you can achieve what you want without getting into how Windows assigns unique identifiers to each removable drive. Maybe I'm misunderstanding the trouble you're experiencing, but would using the subst command to create different virtual drives for each microSD do the trick?
Well, I was trying to follow the example provided by the original batch file:
When you execute the "DATE", "TIME" and "VOL" commands in "DOS box" of Windows XP you the the following in return:
Microsoft Windows XP [Version 5.1.2600]
 Copyright 1985-2001 Microsoft Corp.
C:\>date
The current date is: 01/27/2008
Enter the new date: (mm-dd-yy)
C:\>time
The current time is: 22:36:21.19
Enter the new time:
C:\>vol
Volume in drive F is STRIDERX
Volume Serial Number is 0000-0000
C:\>
The original batch file pieced together the date in this manner:
set folder=%date:~10,4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2%
%date:~10,4% --- this returns the portion of the DATE command output starting at character position 10 and 4 characters after that which corresponds to the year. In this case it would be 2008.
This then gets concatenated with %date:~4,2% --- which returns the portion starting at character position 4 and 2 characters after that corresponding to the month, or 01.
Finally %date:~7,2% produces the day of the month.
Put those all together and you get this: 20080127
Do the samer thing for the TIME command, place an underbar (_)in there and this is the result: 20080127_223621
Well I want to use the VOL command the same way and use the output in naming the folder in the same way the DATE and TIME were used.
I can't seem to find the right incantation of %, ~, and numbers to do this without throwing an error.
What I'm going to try later is to see if I can't hardcode the volume ID in the batch file rather than having it generated on the fly each time I run it.
Using the examples above I want that folder to be named STRIDERX_20080127_223621
This would be fine if it works, but then the batch file is no longer portable without modification. C'est la vie...
striderx