'// *********************************************************************** '// General '// '// Name : vbsDirList '// Version : 1.0 '// Author : Ur I.T. Mate Group '// Website : http://www.it-mate.co.uk '// Support : http://support.it-mate.co.uk '// Licence : Freeware '// Release Date : 08-01-2006 '// Revised : N/A '// '// Notes '// '// You'll need to modify the variables sPath (Line 43) and '// sFilePath (Line 44) to the file and path you wish to use. '// '// Technical Information '// '// Format : VBScript '// Open Source : No '// Distribution : Permitted '// Platforms : Windows 98, 98SE, ME, NT, 2000, XP Home, XP Pro, Server 2003 '// Requirements : Windows Script 5.6 '// '// Windows Script 5.6 Download locations '// '// 9x/ME/NT : http://surl.co.uk/?354 '// 2000/XP : http://surl.co.uk/?353 '// '// Distribution Information '// '// This file may be distributed freely aslong as this file remains unchanged. You may NOT modify, '// mis-use or otherwise attempt to pass this file off as being written by you!. This file, including '// copyrights, contents, remains the sole property of Ur I.T. Mate Group '// '// *********************************************************************** Option Explicit Dim sPath, sFilePath, sHeader, sFooter, objFSO, objTextStream, objFile, colFiles Const fsoForWriting = 2 Const fsoForAppending = 8 '// Setup the input dir and output filename sPath = ".\" '// .\ is the Current directory sFilePath = sPath & "dirlist.html" '// Setup the header for the HTML file sHeader = "Directory Listing for " & sPath & "

Created by vbsDirList.vbs


Directory Listing for " & sPath & "
" & vbcrlf '// Setup the footer for the HTML file sFooter = "" '// Get the files Set objFSO = CreateObject("Scripting.FileSystemObject") Set colFiles = objFSO.GetFolder(sPath).Files AddToFile 2, sFilePath, sHeader For Each objFile in colFiles AddToFile 8, sFilePath, "" & objFile.Name & "
" & vbcrlf Next AddToFile 8, sFilePath, sFooter Set objFSO = Nothing: Set colFiles = Nothing WScript.Echo "Done ..." Function AddToFile(valOpt, strFile, strpath) Set objFSO = CreateObject("scripting.filesystemobject") '// Open the text file Set objTextStream = objFSO.OpenTextFile(strFile, valOpt, True) '//Display the contents of the text file objTextStream.WriteLine strPath '// Close the file and close FSO object objTextStream.Close Set objTextStream = Nothing Set objFSO = Nothing End Function