Welcome to WebmasterWorld Guest from 54.198.200.120

Forum Moderators: bill

Message Too Old, No Replies

adding date into a file name

adding date into a file name

     
7:36 am on Jul 23, 2007 (gmt 0)

Preferred Member

5+ Year Member

joined:June 19, 2006
posts:476
votes: 0


i am wondering if it is possible to add a date or timestamp into a file name using the command line?

i am using this
REN C:\news_full_night.mp3 news_full_night_%DATE%.mp3

but its not working because obviously / are not valid characters.

any ideas?

8:10 am on July 23, 2007 (gmt 0)

Administrator from JP 

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 12, 2000
posts:14652
votes: 65


There are quite a few solutions to be found with a search of the keywords DOS, rename & date [google.com].
5:27 am on July 24, 2007 (gmt 0)

Preferred Member

5+ Year Member

joined:June 19, 2006
posts:476
votes: 0


thank you that was exactly what I needed, if I only knew what words to search for some times...thanks again!

ren test.txt %date:~10%-%date:~4,2%-%date:~7,2%_test.txt

does this
test.txt to
2007-07-24_test.txt

8:00 am on July 24, 2007 (gmt 0)

Administrator from JP 

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 12, 2000
posts:14652
votes: 65


Glad that helped. You know what they say...teach a man to fish... ;)
3:53 am on July 25, 2007 (gmt 0)

Preferred Member

5+ Year Member

joined:June 19, 2006
posts:476
votes: 0


ha thats so funny, i just watched a movie last night where they quoted that quote!

thanks again!

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members