Linux watch equivalent for Windows
I needed to see a filesize change as an automated process was running with no output. On linux, I would simply use the watch command and list (ls) the directory to see the size grow. I didn't expect an exact command match on the windows side, however I did expect something with a somewhat similar functionality. I wrote up a little piece of batch script that handled things, but the output was really ugly made the console scroll far to much. I am fully aware that cygwin already supports the watch tool, but I didn't want to deal with a whole installation and different terminal/command window just for one command. So I decided to minimally clone the linux command called watch.
In standard Microsoft fashion, I wrote it in C# (.net) and rolled it out in a few hours. Mind you, the original process was actually still running by the time I was done. I was able to use my new 'watch' command on Windows to see the files grow. Here's a few screen shots:
picture showing terminal with command executing, all text
picture showing terminal with watch help being shown, all text

Now that the mini app is complete, I figured I'd share more than just my experience.

Here's the source (VS2013) zip: (14KB).
Here's the compiled executable, requires .NET 4.5: watch.exe (13KB)

Disclaimer: I am not responsible if this program causes damage to your computer or business. I do not warrant any of the functionality or capabilities of this application. I am not to be held liable for any damages caused by the use of this application. Use at your own risk.
comments powered by Disqus
Recent Changes