I know that you can execute a program from a known drive using the system command, but what if you don’t know the drive letter? I am trying to create a program that will be written on a CD. The Auto-run will execute this program. I want this program on the CD to have buttons to run exe’s (setup files) on the CD with a single click. Therefore, since the drive changes from PC to PC, I need to know how to run off of the local drive (the one it runs off of now) like the system command. It would be helpful to know how to stop the MS-DOS window from appearing when you run the system command as well.
Assuming this is for Windows, you can use something like GetModuleFileName to obtain the complete filename of the running program including path and drive. As far as the DOS window popping up, I’ve only noticed this for DOS programs and not for Windows programs but, if it is an issue for you, try using ShellExecute instead of system.