PDA

Click to See Complete Forum and Search --> : Getting the current user profile path in c++


silentthread
Dec 16th, 2007, 05:15 PM
Here is how you do it...

#include <iostream>
#include <windows.h>
#include <conio.h>

using namespace std;

int main()
{
char profilepath[250];
ExpandEnvironmentStrings("%userprofile%",profilepath,250);

cout << profilepath;

getch();
return 0;
}