#include <Array.au3>
Local $drivelist = DriveGetDrive("FIXED"), $addspace = 0, $getspace, $systemdrives, $externaldrives
;~ _ArrayDisplay($drivelist)
findexthdd()
Func findexthdd()
RunWait(@ComSpec & " /c " & 'wmic diskdrive get PNPDeviceID, size /format:csv | find /v "USBSTOR" > wmic.txt', @ScriptDir, @SW_HIDE)
$file = FileOpen("wmic.txt")
$readfile = FileRead($file)
$readfile = StringSplit($readfile, ",")
;~ _ArrayDisplay($readfile)
$last = $readfile[0]
$totalsize = $readfile[$last]
$totalsize = $totalsize / 1024 / 1024 / 1024 ;MB
Do
Local $c = 1
$totalsize = StringTrimRight($totalsize, $c)
$c = $c + 1
$return = StringInStr($totalsize, ".")
Until $return = 0
$return = 1
For $w = 1 To UBound($drivelist) - 1
$getspace = DriveSpaceTotal($drivelist[$w]) / 1024
Do
Local $z = 1
$getspace = StringTrimRight($getspace, $z)
$z = $z + 1
$return = StringInStr($getspace, ".")
Until $return = 0
$addspace += $getspace
If $addspace <= $totalsize Then ;463 vs 465
$systemdrives &= $drivelist[$w] & ","
Else
;~ MsgBox(0, "", $drivelist[$w] & " is the f****** external hard drive!")
$externaldrives &= $drivelist[$w] & ","
EndIf
Next
$systemdrives = StringTrimRight($systemdrives, 1)
$systemdrives = StringSplit($systemdrives, ",")
_ArrayDisplay($systemdrives, "SYSTEM DRIVES LIST")
$externaldrives = StringTrimRight($externaldrives, 1)
$externaldrives = StringSplit($externaldrives, ",")
_ArrayDisplay($externaldrives, "EXTERNAL DRIVES LIST")
EndFunc ;==>findexthdd