Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Creating a folder with date, using .bat  (Read 3174 times)

0 Members and 1 Guest are viewing this topic.

darrelll

  • Guest
Creating a folder with date, using .bat
« on: November 18, 2004, 08:47:35 AM »
I am looking for a line of code that will create a folder using the date of creation, or system date. Currently, using the %date% adds "??/??/??" slashs and this not allowed. I am looking for a folder name like this "11182004". can someone please help me out?

Thanks in advance

franksimari

  • Guest
Re: Creating a folder with date, using .bat
« Reply #1 on: November 29, 2004, 08:37:57 PM »
first of all you cannot have two folders with the same name in the same directory  so what you want to do will cause a problem(if you could do it) and you created two folders with the  same date

why not just use underscores
is it this simple what you ask?

md   11_30_04

???

MalikTous

  • Guest
Re: Creating a folder with date, using .bat
« Reply #2 on: November 30, 2004, 10:10:36 AM »
I think you are trying to automatically create a filename based on current date.

copy c:\database\file.dbs "f:\backup\%date:~4,2%%date:~7,2%%date:~-2,2%.dbs"

See if that will work, just change the soource and destination directories and drives to suit your system.
« Last Edit: November 30, 2004, 10:12:21 AM by MalikTous »