The VB trick to get the path of the current temporary directory:
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
fails in VBScript. So?
Based entirely on AnthonyWJones' answer, here is my solution:
Public Enum SpecialFolder
WindowsFolder = 0
SystemFolder = 1
TempFolder = 2
End Enum
Public Function GetFolder(folder As Integer) As String
Dim objFSO As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
GetFolder = objFSO.GetSpecialFolder(folder)
End Function
So, for example, you'd use GetFolder(TempFolder) to obtain the pathname of the user's temp folder.