Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I want a program that will go out and get the size of a certain file every day and append it to a text file. I'll then have a running record of the changes in this files size.
The file is a backup that starts with the same characters each time, but there are numbers on the end of the file that change every day. I was thinking a .bat file in scheduler would do the trick? Can it be done?

Hi
We meet again
Try this. Not sure about scheduler as I never use it.
but I don't see why not.@echo off
rem example file
dir > filename001rem find file folowerd by 3 digits save into tmp.txt
dir /b | findstr /i "filename[0-9][0-9][0-9]" > tmp.txt
for /f %%a in (tmp.txt) do echo %%~za >> logfile.txt

We do meet again. You're on the wrong time zone though!
That code works great. How would I add a date to that? Also, will this append each new file to the logfile.txt record? I ask because if I run it everyday and the old file that was added yesterday is deleted, will it stay in the logfile.txt? I need it to.
To be clear. Every day, a new file is created replacing the old file. If I don't record the information from the old file before the new file is created, it's lost forever.

Hi
Yes as long as the filename as the same format ie FilenameNNN or whatever.
By date I take it to mean system date and not file date.
This code will echo to the logfile the
Date,Time,Filename and Size.for /f %%a in (tmp.txt) do echo %date%
%time% %%~na %%~za >> logfile.txt

Hi
buy the way in your other thread the count wount'nt work because I missed off the percent sign it should have been
ie set /a Count=%Count%+1

![]() |
Automating window switchi...
|
images in SDL
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |