Directory Structure and Folder Names In C++...

AluminumHaste

Active member
I have a problem. I need to code the following chart:
filesearch5po.png

But I don't know how to get the user's login name for the dir name.
What I'm trying to do is search for a file in a directory, but I want to start searching for the file at a certain point. To get there though I need to find the name of the currently logged in user.

Does anyone have any tutorials on how to do this or could offer any advice?
 
There should be a windows API call to get the user and also to get the users settings directory. Unfortunately I don't know what they are.
 
Yeah I found it, but it was getting really complicated in C++ for such a simple program, so I broke down and did it in VB in about 1 hour.:cry:
 
BTW, all you should need to do in order to find the right directory is:

getenv("USERPROFILE")

That points to 'Documents and Settings/user-name'.
 
Back
Top