Name: Mugenlude Date: March 24, 2006 at 09:46:39 Pacific Subject: Rename Filename w/ Date OS: XP CPU/Ram: 3.0/512
Comment:
I have a backup batch file which creates a .log file with starttime, endtime, files backuped, etc.
I combine all of that information into a file called transport.log, I want to rename that file with the current date such as 2006-03-24.log, or better yet 2006-3-24 backuo.log
I'm fairly new to DOS batch files, and DOS commands in general, any help would be appreciated.
I got it figured out... here is what I ended up using.
______________________________
for /f "tokens=1,2" %%u in ('date /t') do set d=%%v for /f "tokens=1" %%u in ('time /t') do set t=%%u if "%t:~1,1%"==":" set t=0%t% set timestr=%d:~6,4%-%d:~0,2%-%d:~3,2%
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE