Find the root drive path of all current logical drives

xiaoxiao2021-03-06  36

1) Use the GetDriveType function:

Declare integer

GetDriveType in "

Kernel32 "String

DGS = 0

For i = 65 to 90

VNAME = CHR (i) ":"

Lx =

GetDriveType (VNAME)

Do Case

Case lx = 2

DGS = DGS 1

Wait wind 'This is a floppy disk'

Case lx = 3

DGS = DGS 1

Wait wind 'this is a hard drive'

Case lx = 4

DGS = DGS 1

Wait Wind 'This is a removable type drive or network drive'

Case lx = 5

DGS = DGS 1

Wait wind 'This is a CD'

Case lx = 6

DGS = DGS 1

Wait wind 'this is a RAM disk'

ENDC ENDF

WAIT WIND 'This machine has:' STR (DGS) 'Drive'

==========================================================================================================================================================

转载请注明原文地址:https://www.9cbs.com/read-63422.html

New Post(0)