Computing.Net > Forums > Programming > DOS: Adding date to file name.

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

DOS: Adding date to file name.

Reply to Message Icon

Name: fintir
Date: October 18, 2004 at 10:34:23 Pacific
OS: W2K Pro
CPU/Ram: 1.4Ghz / 256
Comment:

How can I add the current date to a file name when I do a copy or move?

ex. move c:\1.txt d:\1_%date%.txt (this one doesn't work)




Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: October 19, 2004 at 03:01:14 Pacific
Reply:

First, if you're using DOS, there's no built in %date% var.

If you're using XP cmd.exe, there is.

The syntax you're trying can be made to work IF your date format has no slash, colon or other illegal chars.

M2


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: DOS: Adding date to file name.

Adding .1 to file names thru Batch www.computing.net/answers/programming/adding-1-to-file-names-thru-batch/14558.html

Appending date to file name www.computing.net/answers/programming/appending-date-to-file-name/616.html

Batch file adding text to file also www.computing.net/answers/programming/batch-file-adding-text-to-file-also/16756.html