<html> <head> <title>Directory Listing: Copyright © Loh Hon Chun</title> <script language="JavaScript"> <!-- window.defaultStatus = 'Directory Listing: Copyright © Loh Hon Chun'; //--> </script> <style> a { color:#707070; text-decoration:none; } a:hover { color:#000000; text-decoration:none; } body { font-size: 9pt; color: #2F4F4F; FONT-FAMILY: Arial; margin-top: 20px; margin-left: 50px; } h1 { font-weight: bold; font-size: 18pt; font-family: Verdana; color: #BC8F8F; } .header { font-weight: bold; font-size:10pt; font-family: Verdana; } .displayMsg { font-weight: bold; font-size: 12pt; font-family: Verdana; } .errorMsg { color: #FF0000; font-weight: bold; font-size: 12pt; font-family: Verdana; } </style> </head> <body> <h1>Directory Listing</h1> <script language="VBScript"> <!-- Function RecurseFolders(thisFolder) Set objFolder = objFSO.GetFolder(thisFolder) Document.Write "<span class=""header"">" & objFolder & "</span>" For Each objFile in objFolder.Files Document.Write " <a href=""" & objFolder.Path & "/" & objFile.Name & """>" & objFile.Name & "</a>" Next Document.Write "" If Not objFolder.Subfolders.Count = 0 Then For Each objSFolder in objFolder.SubFolders RecurseFolders(objSFolder) Next End If End Function Dim objFSO, objFolder, objFile, objSFolder Dim folder Set objFSO = CreateObject("Scripting.FileSystemObject") folder = InputBox("Please enter directory") If objFSO.FolderExists(folder) Then Document.Write "<span class=""displayMsg"">Generating listing for <a href=""" & folder & """>" & folder & "</a></span>" Call RecurseFolders(folder) Else Document.Write "<span class=""errorMsg"">Not such directory <u>" & folder & "</u></span>" End If '--> </script> </body> </html>
Computer, Technology, Databases, Google, Internet, Mobile, Linux, Microsoft, Open Source, Security, Social Media, Web Development, Business, Finance
Friday, January 23, 2009
Directory Listing Web Application in VBScript
I just came out with a quick and "dirty" method to perform simple Directory Listing. I mention "dirty" because it is in VBScript and thus will work only on Microsoft Internet Explorer.
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Google url shortener service, goo.gl , is now much improved with newly included features like easier copy and paste, and ability to delete e...
-
I would like to apologize that sigining of my guestbook is not possible at the moment due to an unexpected bug. There is already 74 entries ...
-
As of today, Google will start using a new shortened url - g.co , to promote Google websites. g.co works differently as compared to a long-t...
-
Terms Of Use By downloading or using the app, these terms will automatically apply to you – please read them carefully before using the app....
-
*********** Try to sleep now, close your eyes Soon the birds would stop singing Twinkling stars, are shining bright They'll be watch...
Its really very easy to do the simple directory listing web application in VB Script. I like this method.
ReplyDelete