Need to Find Path to CD Rom for System() Command
Posted on 2002-03-05
I am writing an application to be burned on a CD that needs to access other files on the same CD. For instance, one application on this CD needs to open a .html file also located on the same CD. For testing purposes, I am using ...
but this only works with the c: drive. Obviously, I can also type c:/temp/index.html or whatever the path may be. However, this application is going to be used on many different computers. Many computers have the CD as drive d: but also many have it as a drive e: or drive f:. Somehow, I need to find the path to the current user's CD drive and then use that path within the system() command. NOTE: The system() command uses a const char * as a parameter and I have not been able to figure out how to use a variable instead of a string as shown above. When I try to use a variable ...
const char *temp1 = "c:/temp/acrord32.exe";
a message tells me that temp1 is not recognized as a internal or external command or operable program.
However, system("c:/temp/acrord32.exe"); works fine.
Question is: How do I find the path of the CD ROM and then get that path to work in the system command? I am assuming that I will need a variable for the path so I can add the path to my application.