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

Author Topic: creating a folder and naming it the current date  (Read 2302 times)

0 Members and 1 Guest are viewing this topic.

guru_wannabe

  • Guest
creating a folder and naming it the current date
« on: May 26, 2006, 02:08:53 PM »
can a .bat file be used to create a folder and name it the current system date.  I've tried several different commands, but no luck.  I am trying to create a backup script that will create a folder on a local h.d., name it the current date, copy files to it, and send the new directory to a cd-rw.
Any suggestions.  Thanks

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: creating a folder and naming it the current da
« Reply #1 on: May 26, 2006, 03:08:57 PM »
This may work on your system, then again it may not:

Code: [Select]
@echo off
for /f "tokens=2-4 delims=/ " %%i in ("%date%") do (md %%i-%%j-%%k)

You can arrange the variables i, j, k in any sequence you want.

 8-)

We can customize our response to your system if you'd only mention your OS.
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein