DrSeussFreak
Programmer
I am using this code to check for any drives that are more than 89.9999% free. What I need is to add an e-mail function to my script so that when (pFree > "89.9999999") pulls a value, it lets me know.
Any ideas? Thanks.
Any ideas? Thanks.
Code:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set colDrives = objFSO.Drives
For Each objDrive in colDrives
DIM dLetter
DIM fSpace
DIM tSize
DIM pFree
dLetter = objDrive.DriveLetter
fSpace = objDrive.FreeSpace
tSize = objDrive.TotalSize
pFree = ((objDrive.FreeSpace / objDrive.TotalSize) * 100)
if pFree > "89.9999999" then
Wscript.Echo dLetter & " is low on space, and is currently at " & pFree & " space free."
else
Wscript.Echo dLetter & " is currently at " & pFree & " and so is OK!"
End if
Next