I don't know if anyone provided a code based solution, but here is one that can be run by cscript.exe folderwatch.vbs
folderwatch.vbs:
Function FileExt(n)
dotpos = InStr(n,".")
if dotpos>0 then
FileExt = UCase(Mid(n,dotpos))
else
FileExt = NULL
end...