VBScript » Files Collection » Item

Version: 3.0

Syntax:
object.Item ("filename") [= itemvalue]
filename
Receives the filename associated with the Item that you wish to have returned.

The Item property allows us to retreive the value of an item in the collection designated by the specified key argument and also to set that value by using itemvalue.

Examples

Code:
<%
Dim filesys, demofolder, filecoll, selectfile
Set filesys = CreateObject("Scripting.FileSystemObject")
Set demofolder = filesys.GetFolder("foldername")
Set filecoll = demofolder.Files
selectfile = filecoll.Item("filename")
%>
Explanation:

This code shows how to retrieve an item from a Files collection.