Write a program to display all files containing demo in their name in qtp

Showing Answers 1 - 1 of 1 Answers

Arun Shukla

  • May 26th, 2015
 

Folder location of files
Dim folderLoc
All files
Dim files:files=""
File system object
Set fso=CreateObject("Scripting.FileSystemObject")
Set folder location of files
Set oFolder=fso.GetFolder(folderLoc)
Get all files in oFilesCollection
Set oFilesCol = oFolder.Files
For Each oFile in oFilesCol
check for files containing word "demo"
If InStr(1,oFile.Name,"demo",1)>0 Then
files=files&vbNewLine&oFile.Name
End if
Next
If files<>"" then
MsgBox files
Else
MsgBox "No such files found!!"
End If

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions