I have a test program where I call _wtempnam and it returns NULL. From the same command prompt, when I "echo %TMP%", it points to a valid directory in which I can create a file manually. When calling _wtempnam, I am passing "c:\\" for the directory path (which should be a valid directory). Any ideas on what's going on? Thanks in advance