[已解决]如何识别可移动硬盘?
本帖最后由 hlzxcjx 于 2011-8-31 12:16 编辑本地硬盘与可移动硬盘在分组里是归为同一类的,如图:
用DriveGetDrive ( "FIXED" )可知,它是归为“固定驱动器”的。有什么办法可识别其为可移动硬盘呢? 好像WINAPI可以获取#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global $Bus, $Text, $Drive = DriveGetDrive('ALL')
For $i = 1 To $Drive
$Bus = _WinAPI_GetDriveBusType($Drive[$i])
Switch $Bus
Case $DRIVE_BUS_TYPE_UNKNOWN
$Text = 'UNKNOWN'
Case $DRIVE_BUS_TYPE_SCSI
$Text = 'SCSI'
Case $DRIVE_BUS_TYPE_ATAPI
$Text = 'ATAPI'
Case $DRIVE_BUS_TYPE_ATA
$Text = 'ATA'
Case $DRIVE_BUS_TYPE_1394
$Text = '1394'
Case $DRIVE_BUS_TYPE_SSA
$Text = 'SSA'
Case $DRIVE_BUS_TYPE_FIBRE
$Text = 'FIBRE'
Case $DRIVE_BUS_TYPE_USB
$Text = 'USB'
Case $DRIVE_BUS_TYPE_RAID
$Text = 'RAID'
Case $DRIVE_BUS_TYPE_ISCSI
$Text = 'ISCSI'
Case $DRIVE_BUS_TYPE_SAS
$Text = 'SAS'
Case $DRIVE_BUS_TYPE_SATA
$Text = 'SATA'
Case $DRIVE_BUS_TYPE_SD
$Text = 'SD'
Case $DRIVE_BUS_TYPE_MMC
$Text = 'MMC'
EndSwitch
ConsoleWrite(StringUpper($Drive[$i]) & ' => ' & $Text & @CR)
Next u盘获取不到
页:
[1]