FOR /f "tokens=1-3 delims=/" %%a in ('date /t') do set vl=%%a%%b%%c
md "%vl%"
this would create a folder named Tue 05042004
how can i get rid of the "Tue " part?
i want the folder to be just 05042004
Try the Mount/\Command GetLogDate, part of the FREE
Advanced Command Library (ntlib.cmd). GetLogDate
CONSISTENTLY returns yyyymmdd and saves this value
in variable %#LogDate%. For details, see
(
http://TheSystemGuard.com/MtCmds/GetValue/GetLogDate.htm)
(
http://ntlib.com)
*******
In your specific case, the syntax would be:
%.GetLogDate% %.Silent%
MD %#LogDate:~4,4%%#LogDate:~0,4%
*******
-tsg
/-----------------+---------------+----------------------\
| COMPATIBILITY | CLARITY | SPEED |
| Write code ONCE | Make it clear | THEN...Make it fast! |
\-----------------+---------------+----------------------/
400+ command-line resources using ONLY native NT commands!
(
http://TheSystemGuard.com/default.asp#MasterCommandList)