- jeg har prøvet en del forskellige kombinationer, bl.a. nedenstående, men her kommer alle undermapper i output ud som om de ligger i roden:
ListFolderContents("c:\Test") sub ListFolderContents(path) dim fs, folder, file, item, url set fs = CreateObject("Scripting.FileSystemObject") set folder = fs.GetFolder(path)
Set myFSO = CreateObject("Scripting.FileSystemObject") Set WriteStuff = myFSO.OpenTextFile("C:\test\yourtextfile.htm", 8, True) WriteStuff.WriteLine(Skriv) WriteStuff.Close SET WriteStuff = NOTHING SET myFSO = NOTHING
for each item in folder.SubFolders ListFolderContents(item.Path) next
'Display a list of files.
for each item in folder.Files url = MapURL(item.path) Skriv = Skriv & ("<li><a href=""" & url & """>" & item.Name & "</a> - " & item.Size & " bytes, " & "last modified on " & item.DateLastModified & "." & "</li>" & vbCrLf) next
Skriv = Skriv & ("</ul>" & vbCrLf)
Skriv = Skriv & ("</li>" & vbCrLf)
end sub
Set myFSO = CreateObject("Scripting.FileSystemObject") Set WriteStuff = myFSO.OpenTextFile("C:\test\yourtextfile.htm", 8, True) WriteStuff.WriteLine(Skriv) WriteStuff.Close SET WriteStuff = NOTHING SET myFSO = NOTHING
function MapURL(path)
dim rootPath, url
'Convert a physical file path to a URL for hypertext links.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.