Hi. Today, we have a simple and easy to use function to add a folder to a specific directory.
Call the function like in the example below:
1. For the first argument, enter a folder path where you want to create a directory
2. For the second argument, enter the folder name
3. Run the script and you should see the "NewTestFolder" in your C directory
funAddNewFolder "C:/", "NewTestFolder"
Function funAddNewFolder(path, folderName)
Dim f, fc, nf
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(path)
Set fc = f.SubFolders
Please leave comments and questions below!
Latest posts by Admin (see all)
- SQA QTP tutorial – WebList identified as a web element and how to select an item from this list - December 9, 2015
- Automation QTP tutorial-double clicking on any object - December 4, 2015
- Software Automation QTP tutorial – 5 top reasons for using automation - November 23, 2015