I would like to use the MkDIR command to create a directory with a name that is a date stamp. How do I retrieve the date (now) from the system and return it as a string that I can use with MkDir?
You can get Format to return many different styles of date strings. Look up the Format function in the help file, then click See Also and choose "User-defined date/time formats". Rick Sprague
Format() returns a string. Save the string in a variable. Use the variable name as part of the argument to MkDir. For example:
strTodaysDate = Format(Now(), "mm-dd-yy"
MkDir CurDir & "\" & strTodaysDate
If you ran this today while your current directory was C:\My Documents, it would create a directory C:\My Documents\03-17-01. Rick Sprague
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.