Computing.Net > Forums > Disk Operating System > DOS directory with today's date & time

DOS directory with today's date & time

Reply to Message Icon

Original Message
Name: Mucky
Date: July 27, 2002 at 09:00:52 Pacific
Subject: DOS directory with today's date & time
Comment:

Please help. How to I create a DOS directory with the name MMDDYYHHMM for today's date. I am working in the Windows NT 4 environment. I have tried the suggestions posted.

With
FOR /F "tokens=2,3,4 delims=/- " %a in ("%DATE%") do set CDATE=%%a%%b%%c

I get the message "c was unexpected at this time."

Thanx for any help.



Report Offensive Message For Removal

Response Number 1
Name: mucky
Date: July 27, 2002 at 11:46:13 Pacific
Subject: DOS directory with today's date & time
Reply: (edit)

Never mind.


Report Offensive Follow Up For Removal

Response Number 2
Name: Secret_Doom
Date: July 31, 2002 at 16:42:05 Pacific
Subject: DOS directory with today's date & time
Reply: (edit)

If you're on the command prompt, use:

FOR /F "tokens=2,3,4 delims=/- " %a in ("%DATE%") do set CDATE=%a%b%c

If you're on a batch file, use:

FOR /F "tokens=2,3,4 delims=/- " %%a in ("%DATE%") do set CDATE=%%a%%b%%c

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: DOS directory with today's date & time

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software