Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function obtains the path of the directory designated for temporary files.

Syntax

DWORD GetTempPath(
  DWORD 
ccBuffer, 
  LPTSTR 
lpszBuffer
); 

Parameters

ccBuffer

[in] Length, in characters, of the string buffer specified by the lpszBufferparameter.

lpszBuffer

[out] Pointer to a string buffer that receives the null-terminated string specifying the temporary path. The retrieved string ends with a backslash (\).

Return Value

The length, in characters, of the string copied to lpszBuffer, not including the terminating NULL character, indicates success. If the return value is greater than the size of ccBuffer, the return value is the size of the buffer required to hold the path. Zero indicates failure

Requirements

Header winbase.h
Library coredll.lib
Windows Embedded CE Windows CE 2.11 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

File I/O Functions

Other Resources

SHGetSpecialFolderPath