Files.Count

JScript2.0+Syntax

							files.Count

Description

The Count property returns the number of items in the Files collection.

Example

Listing 9.67 shows how to use the Count property to get the number of items in the Files collection.

Listing 9.67 Example of the Count Property
 <html> <body> <script language="JScript"> <!-- Hide // function gets the count of the file collection // in a specified folder. function getCount(foldername) { var myObject, f, filesCount; // Create an instance of the FileSystemObject myObject = new ActiveXObject("Scripting.FileSystemObject"); f = myObject.GetFolder(foldername); // gets the number of files in a folder filesCount = f.files.Count; document.write("The number of files in this folder is: " + filesCount); ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.