Finding an unknown path

There's a few files i need to get to from a game's dir that has more than one version and there's no telling which path the user installed the program to.

My initial thought was to search the registry, but I only have the newest version of the game, and there's alot more than one key point in all directions.

I could have the user input their directory, but I'd much rather not do this considering the program is meant to run once in the background and do many more things. I want to exhaust all other possibilities before I go that route.

I also thought about using the native windows indexing system, but i personally don't index my folders. any other ideas?

The path were the .exe is started from is actually provided to the main() or the WinMain() function.

If there is nothing particular done with the start path you can use relative path. The current path at start is usually set to the exe path.
im not running the executable, i'm just using it to find the folder hierarchy, which doesn't change, to find the container files i need to extract.

a really lazy way could just let windows do the work...

system("dir /s *pattern*.* > filename.txt"); (or shellexecute or spawn or whatever your favorite call here is).
...
parse("filename.txt") //you write this, extract what you need.

Last edited on
Topic archived. No new replies allowed.