Richard COnnell wrote:
> The batch file should be able to figure out what date it
> is on the PC. Then it should be able to locate the 4-5 log
> files in question on the HDD and rename them simply by
> adding OLD at the start or the end of the original name of
> the file. This does not affect the date collection as all
> the info is still available to the user in the event of a
> machine problem.
There is no problem for a batch file to figure out what date
it is on the PC.
for /f "tokens=3 delims=/ " %%a in ('date /t') do set day=%%a
>
> EG.
> Current filename is "PLCIOLOG_03"
> I want this renamed to "PLCIOLOG_03_OLD"
Well, this is pretty easy:
if exist PLCIOLOG_%day%_OLD del PLCIOLOG_%day%_OLD
move PLCIOLOG_%day% PLCIOLOG_%day%_OLD
>
> The system keeps these files for a period of 1 calendar
> month and then overwrites them. Each day of a month has a
> log which is saved to a file with the date of that day in
> the filename as above. At then end of the month I will
> have 30/31 Logfiles which should be called PLCIOLOG_01_OLD
> up to PLCIOLOG_31_OLD. These will be the "BIG" files
> because these will have their name changed at say 23-30
> Hrs to make sure the LOG being saved at midnight is as
> small as possible to reduce the chances of hanging the PC.
>
> Am I sounding a bit long winded
>
> THKS
>
>
>
>>-----Original Message-----
>>Richard wrote:
>>
>><<<<snip>>>>
>>
>>>Can I write a macro/program which will be able to
>>>automatically rename these text logfiles at a time
>
> which
>
>>>would be referenced to the real time on the PC clock.
>
> This
>
>>>means that the Vision applicattion will not be closing
>>>these huge files, but explorer would. And this I hope
>>>would prevent the hanging of the PC's
>>>
>>>Any help
>>
>>Yes, you can automatically rename the files by running a
>>batch file through the Task Scheduler at a predetermined
>>time. What should the new names of the files be?
>>
>>
>>--
>>Phil Robyn
>>Univ. of California, Berkeley
>>
>>u n z i p m y a d d r e s s t o s e n d e - m a
>
> i l
>
>>.
>>
--
Phil Robyn
Univ. of California, Berkeley
u n z i p m y a d d r e s s t o s e n d e - m a i l
|