Enrico,
There is a downside to putting temp files in the current directory when the program is being run from a server. This slows down the application.
It might be better (when TEMP isn't found) to check for c:\temp and if it doesn't exist, then create it and use this instead.
I know most Windows versions have a c:\windows\temp but some versions have security which won't allow users write access to it.
There is also an upside to using the server to hold temp files, and that is that any orphan temp files can be periodically deleted either by the application or an administrator.
James