Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rename file using timestamp 1

Status
Not open for further replies.

trolley

Programmer
Jan 29, 2004
62
US

I am trying to rename a zip file with a timestamp within the name. Example:

ERA.ZIP ERA-050330.ZIP

I am trying to archive the file after being processed.
 
for /f "tokens=2-4 delims=/ " %%a in ('DATE /T') do set Date=%%a%%b%%c
rename *.zip *-%date%.zip

I do not think you need to do this, but what the heck:
attrib +a *.zip

(I think the archive bit will be set automaticly).



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top