' =============================================================
' function: GetTemporaryFileName
' desc : Generates a unique file name in the windows
' temporary folder
' params : none
' returns : A unique temporary file, including path
' =============================================================
Function GetTemporaryFileName
' function: GetTemporaryFileName
' desc : Generates a unique file name in the windows
' temporary folder
' params : none
' returns : A unique temporary file, including path
' =============================================================
Function GetTemporaryFileName
Const TemporaryFolder = 2
Dim objFS
Dim objTempFolder
Dim objTempFolder
' create the file system object
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFS = CreateObject("Scripting.FileSystemObject")
' get the path to the temporary folder
Set objTempFolder = objFS.GetSpecialFolder(TemporaryFolder)
Set objTempFolder = objFS.GetSpecialFolder(TemporaryFolder)
' return the path plus a unique temporary file name
GetTemporaryFileName = objTempFolder.Path & "\" & objFS.GetTempName
GetTemporaryFileName = objTempFolder.Path & "\" & objFS.GetTempName
' destroy the object
Set objFS = Nothing
Set objTempFolder = Nothing
Set objFS = Nothing
Set objTempFolder = Nothing
End Function 'GetTemporaryFileName
0 comments:
Post a Comment