Sign in to follow this  

Determine absolute file paths

This topic is 4105 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone, I'm in the process of writing a custom auto-launch program for distribution on CD. It's been a while since I've written in C++, and I'm really fuzzy on the syntax. All I need to do it open a web browser with an html file from the cd, but the file is in a folder in the cd. I can access it just fine if the file's in the root of the CD, but would I access it in the folder. Here's what works when it's in the CD root: ShellExecute(NULL, "open", "index.htm",NULL, NULL,SW_SHOWNORMAL); But it doesn't work when I try something like: ShellExecute(NULL, "open", "html/index.htm",NULL, NULL,SW_SHOWNORMAL); Firefox says doesn't know how to open the address. Any ideas? Thanks in advance!

Share this post


Link to post
Share on other sites
My first guess would be to try using the path "./html/index.htm" or ".\\html\\index.htm". The "." means "current directory". Otherwise, you should be able to use GetModuleFileName() to determine the full path to the currently executing exe, which I'm guessing is in the root directory of the CD. Then you can parse that to get the root folder minus the exe filename.

Share this post


Link to post
Share on other sites

This topic is 4105 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this