Ullan
Ullan

Reputation: 1341

How to get the "temp folder" in Windows 7?

In Windows 7, how can I get programatically the system temporary folder?

Upvotes: 6

Views: 14038

Answers (3)

Phil Hannent
Phil Hannent

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

nulltoken
nulltoken

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

James M
James M

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

Related Questions