Script to List all Immediate Folders Inside a Folder
Dim fso
Dim ObjFolder
Dim ObjOutFile
Dim ObjSubFolders
Dim ObjSubFolder
'Creating File System Object
Set fso = CreateObject("Scripting.FileSystemObject")
'Getting the Folder Object
Set ObjFolder = fso.GetFolder("D:\QTP")
'Creating an Output File to write the Folder Names
Set ObjOutFile = fso.CreateTextFile("D:\QTPsFiles.txt")
'Getting the list of SubFolders
Set ObjSubFolders = ObjFolder.SubFolders
'Writing Name and Path of each Subfolder to Output File
For Each ObjSubFolder In ObjSubFolders
ObjOutFile.WriteLine(ObjSubFolder.Name & String(50 - Len(ObjSubFolder.Name), " ") & ObjSubFolder.Path)
Next
ObjOutFile.Close
Dim fso
Dim ObjFolder
Dim ObjOutFile
Dim ObjSubFolders
Dim ObjSubFolder
'Creating File System Object
Set fso = CreateObject("Scripting.FileSystemObject")
'Getting the Folder Object
Set ObjFolder = fso.GetFolder("D:\QTP")
'Creating an Output File to write the Folder Names
Set ObjOutFile = fso.CreateTextFile("D:\QTPsFiles.txt")
'Getting the list of SubFolders
Set ObjSubFolders = ObjFolder.SubFolders
'Writing Name and Path of each Subfolder to Output File
For Each ObjSubFolder In ObjSubFolders
ObjOutFile.WriteLine(ObjSubFolder.Name & String(50 - Len(ObjSubFolder.Name), " ") & ObjSubFolder.Path)
Next
ObjOutFile.Close
No comments:
Post a Comment