Welcome to WebmasterWorld Guest from 54.226.60.235

Forum Moderators: bill

Message Too Old, No Replies

adding date into a file name

adding date into a file name

     

drooh

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

5+ Year Member



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?

bill

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

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



There are quite a few solutions to be found with a search of the keywords DOS, rename & date [google.com].

drooh

5:27 am on Jul 24, 2007 (gmt 0)

5+ Year Member



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

bill

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

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



Glad that helped. You know what they say...teach a man to fish... ;)

drooh

3:53 am on Jul 25, 2007 (gmt 0)

5+ Year Member



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

thanks again!

 

Featured Threads

Hot Threads This Week

Hot Threads This Month