Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Rename Filename w/ Date
Name: Mugenlude Date: March 24, 2006 at 09:46:39 Pacific 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.
Name: Mugenlude Date: March 24, 2006 at 12:18:42 Pacific
Reply:
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%
Summary: Hi there... While it is possible to rename a file to a file that has the date in it, the specific format you use is invalid as a filename. there can be no slashes "/" in a filename, DOS uses these to...
Summary: Hello techies, I have this script but it gives me an error trying to rename export.txt to export.date.time.txt format, any ideas? C:\Inetpub\wwwroot>copy export.txt export.11062003.1:36p.txt The filen...
Summary: I'm have been trying to figure a way to write a batch file that will automatically rename a specific file by the date and time. Someone Put One Idea Way On But This Does Not Seem To Work. The Problem...