View Single Post
  #1 (permalink)  
Old 11-23-2007, 03:30 AM
alexanderd79@googlemail.com
Newsgroup Contributor
 
Posts: n/a
Batch file to rename with time and date

Hi

I have a batch file that renames a file and appends the time on the
end of the filename. What I need it to do is append both the time and
date at the same time. My line of code is:

for /f "tokens=1-5 delims=:" %%d in ("%time%") do rename
"filename.xls" "filename"%%d-%%e-%%f.xls

I'm sure i can do this in one line but not sure how to add the %date%
in correctly

Any help appreciated

Thanks
Reply With Quote

 
Old 11-23-2007, 03:30 AM