/ **
* Title: File List Generator
*
* DESCRIPTION:
*
* pre>
*
* USAGE:
*
* 1. Save the code to a file named 'afile.js';
* 2. Drag a folder icon on the 'Afile.js'
* Or Run Command 'CScript% Path% / Afile.js C: / Windows /';
* 3. The Find The 'Index.htm' In The Folder.
* pre>
*
* Version: 1.0
* Author: mruan (at) COMGI.COM
* Copyright: freeware.
* /
VAR fso = new activxObject ("scripting.filesystemObject");
// Get Folder Path
Var strfolder = wscript.Arguments (0);
VAR OFOLDER;
// Get Folder Object
OFOLDER = fso.getfolder (strfolder);
// Get Files and Generate HTML
FC = New Enumerator (OFOLDER.FILES);
s = "";
For (var i = 0; fc.atend (); fc.movenext (), i )
{
S = "
/ n"; S = "
S = fc.Item (). Name;
S = "
TD> / N";S = "
S = fc.Item (). size;
S = " td> / n";
S = "
S = fc.Item (). TYPE;
S = " td> / n";
S = "
S = New Date (fc.Item (). datelastmodified) .tolocalestring ();
S = " td> / n";
S = " TR> / N";
}
// Create File
Var OindexFileStream = fso.createtextfile (Strfolder "//index.htm", true); // generate HTML and WRITE TO FILE
OINDEXFIESTREAM.WRITELINE ("");
OINDEXFILESTREAM.WRITELINE ("
");OINDEXFIESTREAM.WRITELINE ("
File List Gernerator 1.0 Title>"); OINDEXFIESTREAM.WRITELINE (" HEAD>");
OINDEXFIESTREAM.WRITELINE ("