Determine if inserted media is CD or DVD

Hi.I searched all over for this…
How can I determine if it’s a CD or a DVD that is inserted on the drive?
The CD/Dvd is already recorded.

I downloaded nero SDK, to give it a shot:
I tried NeroCom example which tells me that Media Type is unknown.

Then neroCMD:
NeroCMD --diskinfo --drivename

returns for a DVD+R:


unknown, not writable, 0 blocks free, finalized

Medium flags:
Layer 0 max blocks: 0
Total capacity:     2295104
Book type:          DVD-ROM

Track info:
  ### Type   Start      Stop       Length     Sess# ISRC
  ---+------+----------+----------+----------+-----+----
  01. data   0x00000000 0x0020924f 0x00209250     1
Ok.

For a CD:


unknown, not writable, 0 blocks free, finalized

Medium flags:
Layer 0 max blocks: 0
Total capacity:     178826
Book type:          unknown

Track info:
  ### Type   Start      Stop       Length     Sess# ISRC
  ---+------+----------+----------+----------+-----+----
  01. data   0x00000000 0x0002ba89 0x0002ba8a     1

How can I sucessfully determine if the media inserted on the drive is a CD/dvd+R/dvd-R/dvd-rw/dvd+rw??
I’m coding in VB.net but any language will do, if it can do this.
It can be using windows functions or in any other way…nero SDK seemed to be a solution but it isn’t .:frowning:

You could get this information with the NeroSDK.

Just use the function:
NERO_MEDIA_TYPE NeroGetCurrentMediumType(NERO_DEVICEHANDLE aDeviceHandle);

the input parameter is a device handle you obtain with
handle = NeroOpenDevice(g_pAktDeviceInfo);

The return value is the MediaType you are looking for. To convert the enum value to a string use:

char *NeroGetTypeNameOfMedia(NERO_MEDIA_SET media,void *reserved);

e.g. code snippet:

handle = NeroOpenDevice(g_pAktDeviceInfo);
if(handle)
{
mediaTypeInRecorder = NeroGetCurrentMediumType(handle);
strTypeNAmeOfMedia = NeroGetTypeNameOfMedia(mediaTypeInRecorder, NULL);
if (strTypeNAmeOfMedia)
{
_tprintf(_T(“TypeName of Media in Recorder: %s
”), strTypeNAmeOfMedia);
}
}

can one help to use java to write CD/DVD?