I am using the System.IO.Path.GetTempPath()
method to retrieve the temporary folder from environment variables. However, I am finding that this will always return the TEMP or TMP variable for the current User if it exists otherwise it will return the System TEMP or TMP variable.
Is there a way to always get the System TEMP variable?
I am aware of several other questions on SO about the Path.GetTempPath() method where answers are referencing the documentation from MSDN about how this method decides what to return. I am aware of the behavior of this method from MSDN and I am asking if there is another way to ensure I am getting the System Temporary Folder.
Environment.GetEnvironmentVariable
, i.e. what arguments to pass it, etc. In particular, the OP wanted to know how to "get the System TEMP variable", and you didn't say how to do that. In other words, your answer is best incomplete. – Urbanist