I need to delete all the folders in current directory that starts with say \"foo\" followed by date
for example we have
I know this is old, but I thought it would be worth mentioning that the FOR command creates parameter variables which are identified with a letter rather than a number (e.g. %%G), so, in order to avoid confusion between parameters and pathname format letters, avoid using the letters (a, d, f, n, p, s, t, x, z) as FOR parameters or just choose a FOR parameter letter that is UPPER case.
Format letters are case sensitive, so using a capital letter is also a good way to avoid conflicts, eg. %%A rather than %%a.
Reference