You really don't need special software to do a straight delete of all files in any folder, this can be done with a simple batch file or from the command line:
del /s /q /f %temp%\*
del /s /q /f %windir%\temp\*
The first will get the current user temp folder, the other will get the system temp folder that some applications like to use.
EDIT: Per request, here is an explanation of the switches used, as found on MS Documentation:
/f : Forces deletion of read-only files.
/s : Deletes specified files from the current directory and all
subdirectories. Displays the names of the files as they are being
deleted.
/q : Specifies quiet mode. You are not prompted for delete
confirmation.
To answer the question specifically:
What is the difference between the two?
There is no difference. They are just different aliases for the same path. As Mark mentioned, some programs use %TMP%
while other use %TEMP%
. Windows assigns both to the same path by default to ensure consistency between different programs, and even protect against developer errors such as using both in the same program.
Also note that the %Path%
variable has nothing to do with either %TMP%
or %TEMP%
. %Path%
is a system variable, while %TMP%
and %TEMP%
are both system variables as well as user variables. The system versions link to C:\windows\TEMP
. AFAIK, only the "System" user can actually use those variables, as evidenced by a simple test; open a cmd window and type in echo %TMP%
or echo %TEMP%
, and it returns the path defined in the user version of the variables. However since %Path%
has no user version (by default), you can do echo %Path%
and it returns the value of the system variable.
I'm not entirely sure how programs use the "Path" system variable, which is likely what cygwin was referring to, but regardless, I can assure you it has nothing to do with TMP or TEMP.
Hope that answers your question.
EDIT: I just remembered what %Path%
is for — it lets you access any files that are in any of the paths specified in the variable without needing to use the full path to the file. For example, adding "C:\myprog\bin" to %Path% will let you just type myprog
or myprog --help
etc into the command-line without having to type out the full path, like "C:\myprog\bin\myprog.exe" --help
. Of course command-line use is only an example, it lets any program or interface access any kind of file without needing the full path.
Best Answer
Sysinternals filemon will be the solution.
FileMon
Update : I think it is replaced by Process Monitor.
Process Monitor