How to get unique Temp File Name
Posted on January 4, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 | 'System & API - How to get unique Temp File Name Option Explicit Private Declare Function GetTempFileNameA Lib "kernel32" (ByVal lpszPath As String, _ ByVal lpPrefixString As String, ByVal wUnique As Long, ByVal lpTempFileName As String) As Long Public Function GetTempFileName() As String Dim s As String, s2 As String s2 = GetTempPath s = Space(Len(s2) + MAX_FILENAME_LEN) Call GetTempFileNameA(s2, App.EXEName, UNIQUE_NAME, s) GetTempFileName = Left$(s, InStr(s, Chr$(0)) - 1) End Function |
Related posts:
- How to Create a temporary file
- How to get Temp Path
- How to Return Volume Name for given Drive letter
- How to Get windows temp path
- How to find the associated program for a file
- How to Return a volume’s serial number
- How to show File Open dialog without using Common Dialog Control
- How to get System Directory
- How to Return the file portion of a file + pathname without extension (in two ways)
- How to Get file extension for a given file (in two ways)