I would like give the result of coding provided by the "pancham". Result of the script (reportedly, of course, to hard drive):
Code:
C:
documents and settings
inetpub
program files
recycler
winnt
autoexec.bat
boot.bak
boot.ini
config.sys
io.sys
msdos.sys
ntdetect.com
ntldr
pagefile.sys
The script can be inserted into a function that receives as parameter the path. Now we have to make the folder names clickable. Clicking on the name of the folder, the path of the folder is passed to the function which redraws the tree with all subfolders and files. This script uses some commands like the span tags and innerHTML does not own the VBScript, but that increase the capabilities of this language.
HTML Code:
<HTML>
<HEAD>
Visual Studio 6.0"> <META NAME="GENERATOR" Content="Microsoft
<TITLE> </ TITLE>
</ HEAD>
<BODY>
<SCRIPT Language=vbscript>
<! -
navigation function (path)
Dim drive, folder, subfolder, elemFolder
Set fso = CreateObject ("Scripting.FileSystemObject")
Set folder = fso.GetFolder (path)
September subfolder = folder.Subfolders
carfiles.innerHTML = path & "<br>
For Each subfolder in elemFolder
nomefolder = replace (lcase (elemFolder), lcase (path ),"")
carfiles.innerHTML carfiles.innerHTML & = "<b> <span
style = "cursor: hand" "" & replace (elemFolder ,"","") & "')"">" nomefolder & & "</ span> </ b> <br>
next
September folder.files files =
For Each file in elemFile
carfiles.innerHTML carfiles.innerHTML = & "" &
replace (lcase (elemFile), lcase (path ),"") & "<br> next
end function
//-->
</ SCRIPT>
<div name=carfiles id=carfiles> <span style = "cursor: hand"
C :')"> C: </ span> </ div>
</ BODY>
</ HTML>
The only thing missing to make the tree fully navigable, is the ability to navigate backwards. It might be interesting to try adding this new feature.
Bookmarks