> You can use WMI. It's a bit hokey, but it
> does provide a great deal of system info.
[quoted text clipped - 45 lines]
>
> - Show quoted text -
That looks very promising. Can you tell me where I might find some
documentation on what values are avialable.
-------
Below is the list of CDROMDrive properties. My apologies
that it's a bit big for a post. There's a WMI SDK somewhere,
but I don't have a link offhand. WMI offers a lot of system
info. but it requires that WMI be installed and running.
(Usually not a problem post-Win98.) It's also rather confusing,
with a very clunky syntax that inexplicably emulates SQL.
Most of the WMI stuff is just wrappers around other tools
that are easier than WMI to use, but I don't know of any
other way to get such extensive system info. (Much of it
is in the Registry but WMI also seems to have new low-level
functions. For instance, I can return CPU speed on Win9x,
which is not normally possible.)
There was an article about using WMI i VB in the Sept.
2000 VBPJ. That might be helpful if you can find it. My
own experience has only been with using it in script.
------------------------
CDROMDrive Properties:
------------------------
Property Description
Availability uint16
Read-only
Availability and status of the device. Power Save - Unknown indicates that
the device is known to be in a power save mode, but its exact status is
unknown; Power Save - Low Power Mode indicates that the device is in a power
save state but still functioning, and may exhibit degraded performance;
Power Save - Standby indicates that the device is not functioning but could
be brought to full power quickly; and Power Save - Warning indicates that
the device is in a warning state, though also in a power save mode.
Values are:
1 = Other
2 = Unknown
3 = Running/Full Power
4 = Warning
5 = In Test
6 = Not Applicable
7 = Power Off
8 = Off Line
9 = Off Duty
10 = Degraded
11 = Not Installed
12 = Install Error
13 = Power Save - Unknown
14 = Power Save - Low Power Mode
15 = Power Save - Standby
16 = Power Cycle
17 = Power Save - Warning
Capabilities array (uint16)
Read-only
Capabilities of the media access device. For example, the device may support
random access (3), removable media (7), and automatic cleaning (9).
Values are:
0 = Unknown
1 = Other
2 = Sequential Access
3 = Random Access
4 = Supports Writing
5 = Encryption
6 = Compression
7 = Supports Removable Media
8 = Manual Cleaning
9 = Automatic Cleaning
CapabilityDescriptions array (string)
Read-only
List of more detailed explanations for any of the access device features
indicated in the Capabilities array. Note, each entry of this array is
related to the entry in the Capabilities array that is located at the same
index.
Caption string
Read-only
Short description (one-line string) of the object.
CompressionMethod string
Read-only
Algorithm or tool used by the device to support compression. If it is not
possible or not desired to describe the compression scheme (perhaps because
it is not known), use the following words: "Unknown" to represent that it is
not known whether the device supports compression capabilities or not;
"Compressed" to represent that the device supports compression capabilities
but either its compression scheme is not known or not disclosed; and "Not
Compressed" to represent that the devices does not support compression
capabilities.
ConfigManagerErrorCode uint32
Read-only
Win32 Configuration Manager error code. For values, see
ConfigManagerErrorCode.
ConfigManagerUserConfig Boolean
Read-only
Indicates whether the device is using a user-defined configuration.
CreationClassName string
Read-only
Qualifiers: Key, MaxLen(256)
Name of the first concrete class to appear in the inheritance chain used in
the creation of an instance. When used with the other key properties of the
class, the property allows all instances of this class and its subclasses to
be uniquely identified.
DefaultBlockSize uint64
Read-only
Default block size, in bytes, for this device.
Description string
Read-only
Description of the object.
DeviceID string
Read-only
Qualifiers: Key
Uniquely identifies this CD-ROM drive.
Drive string
Read-only
Drive letter of the CD ROM drive.
Example: "d:\"
DriveIntegrity Boolean
Read-only
Indicates whether files can be accurately read from the CD device. This is
achieved by reading a block of data twice and comparing the data against
itself.
ErrorCleared Boolean
Read-only
Indicates whether the error reported in LastErrorCode is now cleared.
ErrorDescription string
Read-only
More information about the error recorded in LastErrorCode, and information
on any corrective actions that may be taken.
ErrorMethodology string
Read-only
Type of error detection and correction supported by this device.
FileSystemFlags uint16
Read-only
Qualifiers: Deprecated
The FileSystemFlags property is deprecated in favor of FileSystemFlagsEx
FileSystemFlagsEx uint32
Read-only
File system flags associated with the Win32 CD-ROM drive. This parameter can
be any combination of flags, but FS_FILE_COMPRESSION and
FS_VOL_IS_COMPRESSED are mutually exclusive.
Values are:
0x00000001 = CASE_SENSITIVE_SEARCH
0x00000002 = CASE_PRESERVED_NAMES
0x00000004 = UNICODE_ON_DISK
0x00000008 = PERSISTENT_ACLS
0x00000010 = FILE_COMPRESSION
0x00000020 = VOLUME_QUOTAS
0x00000040 = SUPPORTS_SPARSE_FILES
0x00000080 = SUPPORTS_REPARSE_POINTS
0x00000100 = SUPPORTS_REMOTE_STORAGE
0x00004000 = SUPPORTS_LONG_NAMES
0x00008000 = VOLUME_IS_COMPRESSED
0x00010000 = SUPPORTS_OBJECT_IDS
0x00020000 = SUPPORTS_ENCRYPTION
0x00040000 = SUPPORTS_NAMED_STREAMS
Example: 0
Id string
Read-only
Drive letter uniquely identifying this CD-ROM drive.
Example: "d:\"
InstallDate datetime
Read-only
When the object was installed. A lack of a value does not indicate that the
object is not installed.
LastErrorCode uint32
Read-only
Last error code reported by the logical device.
Manufacturer string
Read-only
Manufacturer of the Win32 CD-ROM drive.
Example: "PLEXTOR"
MaxBlockSize uint64
Read-only
Maximum block size, in bytes, for media accessed by this device.
MaximumComponentLength uint32
Read-only
Maximum length of a filename component supported by the Win32 CD-ROM drive.
A filename component the portion of a filename between backslashes. The
value can be used to indicate that long names are supported by the specified
file system. For example, for a FAT file system supporting long names, the
function stores the value 255, rather than the previous 8.3 indicator. Long
names can also be supported on systems that use the NTFS file system.
Example: 255.
MaxMediaSize uint64
Read-only
Maximum size, in kilobytes, of media supported by this device.
MediaLoaded Boolean
Read-only
Indicates whether a CD-ROM is in the drive.
MediaType string
RRead-only
Type of media used or accessed by this device. In this class, the value will
always be "CD-ROM".
Values are:
"Random Access"
"Supports Writing"
"Removable Media"
"CD-ROM"
MinBlockSize uint64
Read-only
Minimum block size, in bytes, for media accessed by this device.
Name string
Read-only
Label by which the object is known. When subclassed, the property can be
overridden to be a key property.
NeedsCleaning Boolean
Read-only
Indicates whether the media access device needs cleaning. Whether manual or
automatic cleaning is possible is indicated in the Capabilities property.
NumberOfMediaSupported uint32
Read-only
When the media access device supports multiple individual media, this
property defines the maximum number which can be supported or inserted.
PNPDeviceID string
Read-only
Win32 Plug and Play device identifier of the logical device.
Example: "*PNP030b"
PowerManagementCapabilities array (uint16)
Read-only
Indicates the specific power-related capabilities of a logical device. The
Enabled value indicates that the power management features are currently
enabled but the exact feature set is unknown or the information is
unavailable. Power Saving Modes Entered Automatically indicates that a devic
e can change its power state based on usage or other criteria. Power State
Settable indicates that the SetPowerState method is supported. Power Cycling
Supported indicates that the SetPowerState method can be invoked with the
PowerState parameter set to 5 (Power Cycle). Timed Power On Supported
indicates that the SetPowerState method can be invoked with the PowerState
parameter set to 5 (Power Cycle) and Time set to a specific date and time,
or interval, for power-on.
Values are
0 = Unknown
1 = Not Supported
2 = Disabled
3 = Enabled
4 = Power Saving Modes Entered Automatically
5 = Power State Settable
6 = Power Cycling Supported
7 = Timed Power On Supported
PowerManagementSupported Boolean
Read-only
Indicates whether the device can be power-managed (can be put into suspend
mode, and so on). The property does not indicate that power management
features are currently enabled, only that the logical device is capable of
power management.
RevisionLevel string
Read-only
Firmware revision level of the Win32 CD-ROM drive.
SCSIBus uint32
Read-only
SCSI bus number for the disk drive.
Example: 0
SCSILogicalUnit uint16
Read-only
SCSI logical unit number (LUN) of the disk drive. The LUN is used to
designate which SCSI controller is being accessed in a system with more than
one controller being used. The SCSI device identifier is similar, but is the
designation for multiple devices on one controller.
Example: 0
SCSIPort uint16
Read-only
SCSI port number of the disk drive.
Example: 1
SCSITargetId uint16
Read-only
SCSI identifier number of the Win32 CD-ROM drive.
Example: 0
Size uint64
Read-only
Qualifiers: Units(Bytes)
Size of the disk drive.
Status string
Read-only
Current status of the object. Various operational and non-operational
statuses can be defined. Operational statuses include: "OK", "Degraded", and
"Pred Fail" (an element, such as a SMART-enabled hard drive, may be
functioning properly but predicting a failure in the near future).
Non-operational statuses include: "Error", "Starting", "Stopping", and
"Service". The latter, "Service", could apply during mirror-resilvering of a
disk, reload of a user permissions list, or other administrative work. Not
all such work is on-line, yet the managed element is neither "OK" nor in one
of the other states.
Values are:
"OK"
"Error"
"Degraded"
"Unknown"
"Pred Fail"
"Starting"
"Stopping"
"Service"
StatusInfo uint16
Read-only
State of the logical device. If this property does not apply to the logical
device, the value 5 (Not Applicable) should be used.
Values are:
1 = Other
2 = Unknown
3 = Enabled
4 = Disabled
5 = Not Applicable
SystemCreationClassName string
Read-only
Value of the scoping computer's CreationClassName property.
SystemName string
Read-only
Name of the scoping system.
TransferRate real64
Read-only
Qualifiers: Units(KiloBytes per Second)
Transfer rate of the CD-ROM drive. A value of -1 indicates that the rate
could not be determined. This could happen, for example, if the CD is not in
the drive.
VolumeName string
Read-only
Volume name of the Win32 CD-ROM drive.
VolumeSerialNumber string
Read-only
Volume serial number of the media in the CD-ROM drive.
Example: A8C3-D032
Steve - 13 Aug 2008 20:04 GMT
> That looks very promising. Can you tell me where I might find some
> documentation on what values are avialable.
[quoted text clipped - 381 lines]
>
> Example: A8C3-D032
Thanks
MikeD - 13 Aug 2008 20:42 GMT
>> Thanks
Don't quote the whole damn message just to say thanks at the VERY end! Any idea how annoying it is to scrolll through everything you
quoted just to see your reply was nothing but "Thanks"?
You need to learn to trim what you're quoting when you reply. <g> Only quote what is necessary for your reply to make sense.

Signature
Mike
Microsoft Visual Basic MVP
Steve Easton - 14 Aug 2008 23:59 GMT
>>> Thanks
>
[quoted text clipped - 3 lines]
> You need to learn to trim what you're quoting when you reply. <g> Only quote what is necessary for your
> reply to make sense.
But, but but but ...it was bottom posted.!!!
<gd&r>

Signature
Steve Easton