Reputation: 1341
In Windows 7, how can I get programatically the system temporary folder?
Upvotes: 6
Views: 14038
Reputation: 12317
You could get the environment variable for the temp folder:
http://msdn.microsoft.com/en-us/library/ms683188%28VS.85%29.aspx
Upvotes: 1
Reputation: 67589
Have you given a try to GetTempPath()?
Retrieves the path of the directory designated for temporary files.
You can find a code sample here.
Upvotes: 2
Reputation: 16718
The GetTempPath function is probably what you're looking for.
TCHAR buf [MAX_PATH];
if (GetTempPath (MAX_PATH, buf) != 0)
MessageBox (0, buf, _T("Temp path"), 0);
Upvotes: 17