Function TempFile() 'We'll use this function to generate a working temp file name 'that we can reliably copy data into and out of while 'we're generating data. We don't actually create the file 'here we just generate the name and verify that a file of 'this name doesn't already exist. We can use this function to 'generate an 8.3 temporary random file name so that we can 'call our other functions recursively or run 2 scripts at the 'same time without encountering weird errors. This function 'does not accept any arguemtents. 'This script is provided under the Creative Commons liscense located 'at http://creativecommons.org/licenses/by-nc/2.5/ . It may not 'be used for comercial purposes with out the expressed written consent 'of NateRice.com Const OpenAsDefault = -2 Const FailIfNotExist = 0 Const ForReading = 1 Set oShell = CreateObject("WScript.Shell") Set oFSO = CreateObject("Scripting.FileSystemObject") sTemp = oShell.ExpandEnvironmentStrings("%TEMP%") Do Until sGenerationIsSuccessful sWorkingFileName = RndFileName If oFSO.FileExists(sTemp & "\" & sWorkingFile) Then 'File exists loop again sGenerationIsSuccessful = False Else 'File Doesn't exist and is safe to use sGenerationIsSuccessful = True End If Loop TempFile = sWorkingFileName Set oShell = Nothing Set oFSO = Nothing End Function