Код:

#Include <WinAPIEx.au3>
$tSDN = _WinAPI_GetDriveNumber('C:')
If (Not @error) And (DllStructGetData($tSDN, 'DeviceType') = 7) Then ; FILE_DEVICE_DISK = 7
$Hdd = DllStructGetData($tSDN, 'DeviceNumber')
$Vol = DllStructGetData($tSDN, 'PartitionNumber')
If _WinAPI_DWordToInt($Vol) = -1 Then
$Vol = 0
Else
$Vol -= 1
EndIf
ConsoleWrite('HDD(' & $Hdd & ',' & $Vol & ')' & @CR)
EndIf
WinAPIEx.au3