Showing posts with label Folder Creation. Show all posts
Showing posts with label Folder Creation. Show all posts

Sunday, 27 April 2014

QTP - UFT - How to create a folder using VBScript

We can use "Scripting.FileSystemObject".

Syntax
strFolderpath = "C:\SampleFolder"
Set obj = Createobject("Scripting.FileSystemObject")
If obj.FolderExists(strFolderpath) = false Then
 obj.CreateFolder strFolderpath
End If
Set obj = nothing


Note:- To run the script copy and paste the script in Notepad and save it with extension ".vbs". Example "CreateFolder.vbs". Double click the file to run the script.
Or
Copy and paste the script in UFT / QTP and press F5 ( i.e. Run Button)