1.

Solve : Create dynamic directories using date?

Answer»

I need to write a script that creates DIRECTORIES based on the current date. When I use the system VARIABLE DATE the slashes are interpreted incorrectly, therefore the new DIRECTORY becomes 3, eg.

DATE=tue 7/27/2004
set dirvar=%DATE%
md %dirvar%

the directories created are tue 7, 07 and 2004

Any ideas??The forward slash character is not a LEGAL character in a directory name, and is interpretted as a 'new command' initial.

Use country.sys to choose a date format that uses HYPHENS or periods to separate the date values, so you get 200407.27, 27-07-04, or something similar as the name of your directory.



Discussion

No Comment Found