/* Create the FileSystemObject */
fso = new ActiveXObject("Scripting.FileSystemObject");
/* Point the Object to a specific folder */
fsofolder = fso.GetFolder("C:\\temp");
/* get a collection of the files contained in that folder */
colFiles = fsofolder.Files;
/* Create an Enumerator so that we can move through the collection */
fc = new Enumerator( colFiles );
/* Create a variable to store an output message in */
var msg = "";
/* Loop through the Enumerator and add each item to our variable */
for (; !fc.atEnd(); fc.moveNext() ){
msg += fc.item() + "\n";
}
/* Show the user the results */
WScript.Echo( msg );