Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MKDIR D:\%DATE%

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Sep 6, 2007
418
BE
Hey,

I create a bat file to create with a shortcut a new map with the current date, with the above I got as the map file

Code:
2007-11-21

I like however the current date but with a format of
20071121 (without dashes). How to ?
 
This cannot be done with a batch file. You will need to use a higher level language program such as Basic or Assembly in order to process the data and interact with the dos.

HTH
--MiggyD

--> It's a bird! It's a plane! No, it's an OS update patch! Ahh!! <--
 
It may be able to do in a batch file. How do you get the 2007-11-21? Show the code that generates that string.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Hey MatrixIndicator
Here's a code which I use in a batchfile that makes several subdirectories with the actual data and the lastone with a timevalue.
Note: use the same seperator in your date (fe "-" = delims=-- or "/" = delims=-/) en place the right one in the code
success,

Stef

@echo off
for /F "tokens=1,2,3 delims=-- " %%i in ('date /t') do set datum=%%k%%j%%i
for /F "tokens=1,2 delims=: " %%i in ('time /t') do set tijd=%%i%%j
echo %datum%
echo %tijd%
md CA_%datum%
md CB_%datum%
md holdings_%datum%
md nav_%datum%
md smf_%datum%
md transactions_%datum%_%tijd%

Echo Subdirectories are Succesfully made!
pause
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top