The following code is provided by Microsoft scripting. I want to modify to check for low disk space ONLY on specified drives via user input OR only on removable drives. Either would work. Any suggestions?
Const CONVERSION_FACTOR = 1048576
Const WARNING_THRESHOLD = 100
Computer = "Workstation1"
Set objWMIService = GetObject("winmgmts://" & Computer)
Set colLogicalDisk = objWMIService.InstancesOf("Win32_LogicalDisk"
For Each objLogicalDisk In colLogicalDisk
FreeMegaBytes = objLogicalDisk.FreeSpace / CONVERSION_FACTOR
If FreeMegaBytes < WARNING_THRESHOLD Then
Wscript.Echo objLogicalDisk.DeviceID & " is low on disk space."
Else
Wscript.Echo objLogicalDisk.DeviceID & " has adequate disk space."
End If
Next
Thanks
Const CONVERSION_FACTOR = 1048576
Const WARNING_THRESHOLD = 100
Computer = "Workstation1"
Set objWMIService = GetObject("winmgmts://" & Computer)
Set colLogicalDisk = objWMIService.InstancesOf("Win32_LogicalDisk"
For Each objLogicalDisk In colLogicalDisk
FreeMegaBytes = objLogicalDisk.FreeSpace / CONVERSION_FACTOR
If FreeMegaBytes < WARNING_THRESHOLD Then
Wscript.Echo objLogicalDisk.DeviceID & " is low on disk space."
Else
Wscript.Echo objLogicalDisk.DeviceID & " has adequate disk space."
End If
Next
Thanks