How to check if folder exists (QTP, VBScript)
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
One response to "How to check if folder exists (QTP, VBScript)"
how to retrive first link of site and save it to datatable in qtp
[ Albert’s note. How to post a random comment and not receive an answer. ]