hent infomationer fra genvej og indsæt i en html fil
Hi all.I have some problems finding out how to get url from at file... I'm trying to make a Script what runs thourgh a folder to find shortcuts and url link and put the infomation into a html file, witch is display on my desktop. Here is til script I made so far:
' Location to where the folder is located.
CONST LinkLocation = "D:\-= My Documents =-\My WSH-Script\Favorites\Links\"
set fso = wscript.createobject("scripting.filesystemobject")
' Open and/or Create the html file.
Set tf = fso.CreateTextFile(LinkLocation & "Desktop-Link.html", True)
'Writing standard html tags to the html file
tf.WriteLine("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>")
tf.WriteLine("<html>")
tf.WriteLine("<head>")
tf.WriteLine("<title>Nyt dokument</title>")
tf.WriteLine("<meta name='generator' content='TSW WebCoder'>")
tf.WriteLine("<style type='text/css'>")
tf.WriteLine("Body {")
tf.WriteLine("Background-color: transparent;")
tf.WriteLine("}")
tf.WriteLine("a, visited, link {")
tf.WriteLine("text-decoration: none;")
tf.WriteLine("font-family: 'Verdana', Arial, Helvetica, sans-serif;")
tf.WriteLine("Font-size: 12px;")
tf.WriteLine("Font-Weight: Bold;")
tf.WriteLine("Color: #000000;")
tf.WriteLine("Letter-spacing: -1px;")
tf.WriteLine("Padding-left: 5px;")
tf.WriteLine("Padding-top: 2px;")
tf.WriteLine("Padding-bottom: 2px;")
tf.WriteLine("Display: block;")
tf.WriteLine("}")
tf.WriteLine("a:hover {")
tf.WriteLine("text-decoration: none;")
tf.WriteLine("font-family: 'Verdana', Arial, Helvetica, sans-serif;")
tf.WriteLine("Font-size: 12px;")
tf.WriteLine("Font-Weight: Bold;")
tf.WriteLine("Color: #000000;")
tf.WriteLine("Letter-spacing: -1px;")
tf.WriteLine("Padding-left: 5px;")
tf.WriteLine("Display: block;")
tf.WriteLine("Background-color: #C0C0C0")
tf.WriteLine("}")
tf.WriteLine("</style>")
tf.WriteLine("</head>")
tf.WriteLine("<body>")
' here comes the script that runs thourgh the folder to find
' subfolders and insert the data from the sub folders.
set objfolder = fso.getfolder(LinkLocation)
set objsubFolders = objFolder.SubFolders
for each folders in objSubFolders
set objfolder = fso.GetFolder(LinkLocation & folders.Name)
set objFiles = objFolder.Files
for each files in objFiles
if lcase(fso.GetExtensionName(files.path)) = "url" then
Arrfile = Split(files.name, ".")
' Here comes the Problem I don't know what command or
' object to activate to read the shortcut infomation and insert it into the href-tag.
tf.WriteLine("<a href='' alt=''>" & Arrfile(0) & "</a>")
end if
next
set objFiles = nothing
set objFolder = nothing
tf.WriteLine("<hr>")
next
set objsubFolders = nothing
set objFolder = nothing
tf.WriteLine("</body>")
tf.WriteLine("</html>")
set fso = nothing
The point with this script is to make an easy way to maintain and update my favorites weblink and common location on my computer (download folder, pictures etc.) At this point the script can't read lnk-files only url-files but when I got stuck with the problem of getting the shortcut infomation from the url-files, I saw no purpose i continuing developing the script.
I know it's a dum noobie question, but I'm realy stuck here and I can't find the neseary infomation on the internet...
So I hope you can help me and in advance, thanks :-)