Computing.Net > Forums > Disk Operating System > How Do I Rename Files By Date

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.

How Do I Rename Files By Date

Reply to Message Icon

Name: Puzzled
Date: March 28, 2001 at 06:27:25 Pacific
Comment:

I'm have been trying to figure a way to write a batch file that will automatically rename a specific file by the date and time.
Someone Put One Idea Way On But This Does Not Seem To Work. The Problem Is That When You Get The Date Off DOS There Is Back Slashes In So You Can Not Rename A File Like This.

Has Anyone Got Any Ideas.
Thank You



Sponsored Link
Ads by Google

Response Number 1
Name: partelbbub
Date: March 28, 2001 at 13:49:52 Pacific
Reply:

If you don't mind adding an executable to call from your batch file, you can use datename.exe, available inside datechk.zip, which is available at my website.


0

Response Number 2
Name: glennire
Date: March 28, 2001 at 18:15:05 Pacific
Reply:

A setdatec.zip file can be found at the University of Vassa website http://garbo.uwasa.fi/pc/batchutil.html. This requires calling setdate.com and uses the included setdate.doc file. The program sets several environment variables which can then be used to customize unique file/directory names with date/time values. I ran the following simple test and it works well. Thank you for the question, I've had this same question for several weeks now. Just got it to work for the first time. Calling the program at least allows great flexibility in date/time values used.

cpdate.bat test file contents with setdate.com and setdate.doc in same directory

@ECHO OFF
setdate > dte.bat
call dte.bat
DEL dte.bat
copy a.txt .\backup\a%TODAY%%HR%%MIN%%SEC%.txt
echo *** File a.txt has been backed up to \backup\a%TODAY%%HR%%MIN%%SEC%.txt ***
echo *** File backup is complete. ***



0

Response Number 3
Name: Laurence
Date: March 30, 2001 at 08:59:04 Pacific
Reply:

I have invented a pure batch solution for parsing dates containing slashes. See here:
http://home7.inet.tele.dk/batfiles/main/batchfaq.htm#73

Batfiles: The DOS batch file programming handbook



0

Sponsored Link
Ads by Google
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 Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: How Do I Rename Files By Date

How do i rename file in DOS www.computing.net/answers/dos/how-do-i-rename-file-in-dos/10063.html

Rename file with date stamp www.computing.net/answers/dos/rename-file-with-date-stamp/12544.html

how do I extract files from 6.2 dos download www.computing.net/answers/dos/how-do-i-extract-files-from-62-dos-download/3354.html