Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I find the cdrom drive?
Message
From
04/12/2000 18:17:18
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00446679
Message ID:
00449114
Views:
17
>You can check all possible drivies in the loop until you find CDROM
>
Declare Integer GetDriveType in Win32API String
>lcCDROM = Null
>FOR lnI=Asc("A") To Asc("Z")
>	IF GetDriveType(Chr(lnI)+ ":") = 5
>		lcCDROM = Chr(lnI)
>		EXIT
>	ENDIF	
>ENDFOR
>
>
>? lcCDROM
>
What about schmucks like me who have more than one, or who want to access a network resource? (I have a DVD drive shared to the net here.)

>

>>Hi Nigel,
>>
>>I tried this method however, it returns a .T. when it
>>finds the cdrom drive and only if I direct it to it.
>>
>>I need to find a user's cdrom drive name, ie d:\ and assign
>>that drive letter to a path statement for my program.
>>
>>Any thoughts? Thanks and have a good day.
>>
>>Becky
>>
>>
>>>GetDriveType will do this.
>>>
>>>Declare Integer GetDriveType in Win32API String
>>>
>>>?GetDriveType("a:\") = 2
>>>?GetDriveType("c:\") = 3
>>>?GetDriveType("d:\") = 5 (CD ROM)
>>>
>>>>VFP 3.0
>>>>
>>>>Hello All,
>>>>
>>>>I need to have my program find the cdrom drive on the installation
>>>>machine and use that path to go between my program on the cdrom
>>>>and the hard drive.
>>>>
>>>>Is there an api function that will accomplish this task?
>>>>
>>>>Thanks,
>>>>
>>>>Becky
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform