I know how to find the CD drive of a machine. but this code does not work for mapped CD-Drives

i.e .I mapped a cd-drive in my machine as i did not have a CD-Drive.the code was not able to detect the mapped CD-drive as a CD-Drive.

how do i solve this problem