Zip Drive

K

Ken Tucker [MVP]

Hi,

The wmi win32_logicaldisk class has information about the drives.
There is no clear zip drive property but take a look at the drive type,
Caption, Description, and PNPDeviceID. Add a reference to system.management
for to use the wmi. Hope this helps.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_logicaldisk.asp

Dim moReturn As Management.ManagementObjectCollection

Dim moSearch As Management.ManagementObjectSearcher

Dim mo As Management.ManagementObject

moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_LogicalDisk")

moReturn = moSearch.Get

For Each mo In moReturn

Dim strOut As String

strOut = String.Format("Drive {0} - Drive Type {1}", mo("Name"),
mo("DriveType"))

Trace.WriteLine(strOut)

Next



Ken
 
L

Lespaul36

I tried that, but it throws an error. I am thinking that mabe it is because
it is an old LPT one.
 
L

Lespaul36

It isn't really an error from win32_logicaldisk, it was a handling error,
but the response comes back blank for pnpdeviceid. I can find the drive,
but it is a matter of gettng the caption for it. I have it saying
"Removable Drive" from using the FileSystemObject. I found that if I search
through some of the explorer registry keys I can sometimes get the name, but
it is iffy.

It would be nice if I could do it for multiple os versions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top