Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I work in a command prompt quite often and around many large (remote) log files. Unfortunatelly, the sizes of these files do not update as the logs grow, unless it would appear the files are touched. I usually use hacks like the following from Cygwin to "touch" the file so that its file size updates:

stat file.txt


head -c0 file.txt

Are there any native Windows constructs that can refresh the file size from the command prompt, as unintrusively as possible and preferrably without transferring any (remote) data, since I often need to refresh the sizes of very large files remotely, to see how large they have grown.

Update: Doing a dir on the file itself seems to update its size:

dir file.txt

The question now is: How do you update all file sizes in a directory, so that they are current? That is:

Enter mystery command, then:

dir should display correct current file sizes.

share|improve this question

i'm not too sure if this will be of help, but after googling for some time, i found this thread in . hope this helps.

share|improve this answer
Not what I was looking for, but very useful info for another issue I have. I gave you a +1 for that! – Michael Goldshteyn Feb 16 '11 at 15:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.