make a folder with the current date as the name with a batch file

N

Neal

Hi there.

I want to schedule a batch file to backup some data.

Each day, I'd like it to run and make a new folder with the current date as
the folder name. How can I do that?

I just want to type up a batch file called copy.bat and have the scheduler
run it.

Thanks, Neal
 
P

Pegasus \(MVP\)

Have a look at the item "Date in file name", posted in this group
only three days ago.
 
R

Ray at

This is asked about 200 times a month. Try looking through this group or
cmdprompt.admin for suggestions. But here's an example of echoing the date
in YYYY-MM-DD format at the command prompt.

for /f "tokens=2-4 delims=/ " %a in ('date /t') do (echo %c-%a-%b)

Ray at home
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top