Pages

Showing posts with label vbscript to get files. Show all posts
Showing posts with label vbscript to get files. Show all posts

Monday 16 July 2012

Get Files in a Folder - VBScript

Following script displays all the files present in a folder
Change the folder name in oFolder




Dim oFSO, oFile, oFolder


Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder("C:\Sample")


For Each oFile in oFolder.Files
 MsgBox oFile.Name
Next