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 file with date and increment
Name: pitrio Date: April 8, 2005 at 23:18:50 Pacific OS: DOS for win2000 server CPU/Ram: xeon
Comment:
Hi, i need a batch file for rename a file. EXAMPLE i have this file :
log_server.txt
i need rename in: log_server_date_I.txt;log_server_date_II.txt;log_server_date_III.txt ecc (infinte for day)
i use for now this code:
cd C:\Documents and Settings\Administrator\Desktop @echo off Rem Get Day,Mth & Year from %Date% set Day=%Date:~0,2% set Mth=%Date:~3,2% set Yr=%Date:~6,4% ren 1.txt 1_%Day%-%Mth%-%Yr%_I.txt
i need the command for increment the number of the name.
If at first you don't succeed, you're about average.
0
Response Number 2
Name: pitrio Date: April 9, 2005 at 04:08:28 Pacific
Reply:
beyond to the 4
0
Response Number 3
Name: wizard-fred Date: April 9, 2005 at 04:42:31 Pacific
Reply:
Only a comment. Roman Numerals will be very hard to do even with a third party application. Also they don't sort when it reaches IX. Dates are better in the form yyyymmdd. If you are going to roll logs that frequently why not use time hhmm. If you are writing your logging application then the system can automatically name the file, no renaming needed.
Summary: I want to create a file with Date and time in one line thru single command. currently I can do only date by "date /T > file.txt". But I want both date and time and in the same line. ...
Summary: Hi All i use the following code in a bat file to scan with irfanview. The file test.jpg is generated and should be renamed with the current time. It works fine with date but when using time there will...
Summary: How do I rename a file with the current date? eg test.txt to text20030422.txt -------------- for /F %%A in ("%DATE%") do ren test.txt test%%C%%A%%B.txt I used the command to renmae my text file, but t...