Files
Files is a collection, which provides a list of all files contained within a folder.
Properties
• Count
• Item
Example
<!DOCTYPE html>
<html>
<body>
<scrip
t language="vbscript" type="text/vbscript">
Dim fso, f, f1, fc, s
Set oFS = CreateObject("Scripting.FileSystemObject")
'get the folder by giving its path
Set f = oFS.GetFolder("D:\PROJECT\")
Set fc = f.Files
'Get Item
Set s = fc.Item("sendmail.vbs")
'Get Count
x = fc.Count
Document.write s
Document.write x
</script>
</body>
</html>
If the above script is saved as HTML and executed in IE,
we would get the following output in the console.
D:\PROJECT\sendmail.vbs
6