Advertisement

10.15.2007 at 05:16AM PDT, ID: 22893329
[x]
Attachment Details

rename files with current date in a bat file

[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.6
i've got a bat file, trying to rename files in a certain directory, just to include the date, such that new files w/the same name will not overwrite them.  i'm trying to test it now, then i would schedule it to run on a daily basis

i don't think i'm doing the bat file correctly.  first, when invoked, it just gives me a 'can't find the specified file' message for each file.  then, it pumps out a blank log

can anybody help me 1st get the rename corrected, and then get the logging corrected, please?  here's a copy of the bat file:


@ECHO OFF
CLS

SET CURRENTDATE=
SET GETSYSDATE=
FOR /F " tokens=1,2,3* delims=/,  " %%i IN ('date /T') DO SET CURRENTDATE=%%i%%j%%k%%l
FOR /F " tokens=1,2,3* " %%i IN ('echo %CURRENTDATE%') DO SET GETSYSDATE=%%j%%k%%l

ren "\\myserver\public\dba\messaging\fix.AAAA.csv" %GETSYSDATE%.csv
ren "\\myserver\public\dba\messaging\fix.BBBB.csv" %GETSYSDATE%.csv
ren "\\myserver\public\dba\messaging\fix.CCCC.csv" %GETSYSDATE%.csv
ren "\\myserver\public\dba\messaging\fix.DDDD.csv" %GETSYSDATE%.csv
ren "\\myserver\public\dba\messaging\fix.EEEE.csv" %GETSYSDATE%.csv
ren "\\myserver\public\dba\messaging\fix.FFFF.csv" %GETSYSDATE%.csv
ren "\\myserver\public\dba\messaging\fix.GGGG.csv" %GETSYSDATE%.csv
ren "\\myserver\public\dba\messaging\fix.HHHH.csv" %GETSYSDATE%.csv
ren "\\myserver\public\dba\messaging\fix.IIII.csv" %GETSYSDATE%.csv
ren "\\myserver\public\dba\messaging\other_file.csv" %GETSYSDATE%.csv >>.\messagingfileslog.txt
Answered By: RQuadling
Expert Since: 01/11/2000
Accepted Solutions: 2152
Computer Expertise: Advanced
RQuadling has been an Expert for 9 years, during which he has posted 13282 comments and answered 2152 questions. RQuadling is just one of 260 experts in the Operating Systems Development Zone. 3 experts collaborated on this answer, which was graded an "A" by the asker.
 
 
20081119-EE-VQP-48 / EE_QW_2_20070628