[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Private [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Function[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] DoDrives() [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Boolean[/COLOR][/SIZE]
[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ret [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Boolean[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Try[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] searcher [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ManagementObjectSearcher([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"root\CIMV2"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"SELECT * FROM Win32_LogicalDisk WHERE (DriveType = 2) "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & _[/SIZE]
[SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"And FreeSpace > 1000000"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] queryObj [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ManagementObject[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]For [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Each[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] queryObj [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]In[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] searcher.Get()[/SIZE]
[SIZE=2]addLogicalDrive(queryObj([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"VolumeName"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]), queryObj([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"DeviceID"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]), queryObj([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"FileSystem"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]), queryObj([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"FreeSpace"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]).ToString, _[/SIZE]
[SIZE=2]queryObj([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Name"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]), queryObj([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Size"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]).ToString, queryObj([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"VolumeSerialNumber"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]).ToString)[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Next[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2]ret = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]True[/COLOR][/SIZE]
[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Catch[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] err [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ManagementException[/SIZE]
[SIZE=2]MessageBox.Show([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"An error occurred while querying for WMI data: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & err.Message)[/SIZE]
[SIZE=2]ret = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]False[/COLOR][/SIZE]
[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Try[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Return[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ret[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Function[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Private [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] addLogicalDrive([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Description [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] DeviceID [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] FileSystem [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], _[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] FreeSpace [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Name [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Size [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] SerialNumber [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]lstDescription.Add(Description)[/SIZE]
[SIZE=2]lstDriveId.Add(DeviceID)[/SIZE]
[SIZE=2]lstFileSystem.Add(FileSystem)[/SIZE]
[SIZE=2]lstFreeSpace.Add(FreeSpace)[/SIZE]
[SIZE=2]lstName.Add(Name)[/SIZE]
[SIZE=2]lstDriveSize.Add(Size)[/SIZE]
[SIZE=2]lstSerialNumber.Add(SerialNumber)[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
[/COLOR][/SIZE]