
Extracting the URL from a url-file
Iam helped me with this. The lnk file is simply text so all you need to do
is open the file for reading and parse out the URL line.
Try something like this:
dim wshshell, fso, file, f, result, rline, fh, fn
const ForReading=1
on error resume next
set wshshell=wscript.createobject("wscript.shell")
file='you can put in the exact path and file name of the link from your
favorites folder d:\winnt\profiles\jeff\favorites\microsoft link.url
set fso=createobject("Scripting.FileSystemObject")
set fh=fso.Getfile(file)
set f=fso.OpenTextFile(file,forReading)
do while f.AtEndOfStream <>True
rline=f.readline
result=Instr(1,rline,"URL",1)
if result="1" then
wscript.echo right(rline,len(rline)-4) 'this is the URL line
else
end if
loop
wshell.quit