Simply navigate to:

HKEY_LOCAL_MACHINE
     \SYSTEM
          \CurrentControlSet
               \Services
                    \LanmanServer
                         \Parameters

Then create a REG_DWORD called DiskSpaceThreshold and set to the desired percentage (remember to use decimal rather than hex) – e.g. 10 for 10%, which happens to be the default. This is covered in this Microsoft KB article.

Note: Your machine will need a restart before this works

You can then use a scheduled task to pick up the event 2013 that this alert spits out, and send you an e-mail:

Details on setting up the task in the accepted answer are here, the gist of it is to set a trigger to look for EventID 2013 in the System log with Srv as the source.

I then wrote a quick and dirty (real dirty!) script which looks at each drive and e-mails you with the free space left in GB. You can get the script here. You’ll also need sendemail which you can get here.

You can then test by using fsutil to make a big file and file up your drive. E.g. fsutil file createnew C:/bigfile.tmp 3000000000


Categories: Uncategorized

Leave a Reply