#include <shlobj.h> ... char dpath[MAX_PATH + 1]; SHGetFolderPath(NULL, CSIDL_DESKTOP, NULL, 0, dpath); printf("%s\n", dpath);