Parent page: Service Functions – System (QTP, VBScript)
Use FileSystemObject.FolderExists method.
Argument should be a full path string.
When to use it? Always before trying to access the folder (delete, rename, or read from) or create files in it.
Note. Always release the object you created when you no longer need it. If you don’t do that then in the long run it’ll cause you memory leakage problem.
Set FSO = CreateObject("Scripting.FileSystemObject") boolRC = FSO.FolderExists(sFolderName) Set FSO = Nothing 'release an object If Not boolRC Then 'do what you need to do if 'folder does not exist End If