tags:

views:

135

answers:

5

Possible Duplicate:
Correct location to save a temporary file in Windows?

Where is a safe place to create tmp file on windows?

+7  A: 

Use the GetTempPath API, or the equivalent in your programming environment (for .NET, that would be Path.GetTempPath).

RichieHindle
+4  A: 

In Win32, you use GetTempFileName, and in .NET, you use System.Io.Path.GetTempFileName.

Not in one of those languages? Check Creating a Secure Temporary File on Rosetta Code.

Mark Rushakoff
+2  A: 

If you're not using a full-blown programming language, you should place temp files in the folder whose name is stored in the environment variable %TEMP% or %TMP%

Diaa Sami
Yes, based on the non-programming nature of the question (no references to a programming language), I would guess this is the answer. If so, this question really belongs on http://superuser.com !
awe
+3  A: 

What about the Temp directory? You can find its location in the %TEMP% environment variable or programmatically using the GetTempPath() function.

Joey
A: 

You can use %TMP% as a valid path that actually points to the users temp folder in windows.

Example (copy thefile.txt to the temp folder and rename to tmpfile.txt):

copy thefile.txt %TMP%\tmpfile.txt

To see where the actual location of the temp folder is, just run

echo %TMP%
awe