homepage Welcome to WebmasterWorld Guest from 54.197.65.82
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Microsoft / Microsoft Windows OS (XP/NT/Vista/Windows 7/8/9/10)
Forum Library, Charter, Moderators: bill

Microsoft Windows OS (XP/NT/Vista/Windows 7/8/9/10) Forum

    
adding date into a file name
adding date into a file name
drooh

5+ Year Member



 
Msg#: 3401740 posted 7:36 am on Jul 23, 2007 (gmt 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?

 

bill

WebmasterWorld Administrator bill us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3401740 posted 8:10 am on Jul 23, 2007 (gmt 0)

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

drooh

5+ Year Member



 
Msg#: 3401740 posted 5:27 am on Jul 24, 2007 (gmt 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

bill

WebmasterWorld Administrator bill us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3401740 posted 8:00 am on Jul 24, 2007 (gmt 0)

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

drooh

5+ Year Member



 
Msg#: 3401740 posted 3:53 am on Jul 25, 2007 (gmt 0)

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

thanks again!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft Windows OS (XP/NT/Vista/Windows 7/8/9/10)
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved