Create Alias to URL?

Bernard Devlin bdrunrev at gmail.com
Sun Feb 7 10:14:21 EST 2010


On Sat, Feb 6, 2010 at 5:14 PM,  <Roger.E.Eller at sealedair.com> wrote:
>
> I am using Rev 4.0 on WinXP. The create alias command will work for a file
> or a folder, but not a URL to an internet page. Looking at the properties
> of a FILE.lnk compared to one made from a URL (saved from internet
> explorer), the main difference is the middle tab. For a file it is
> "Shortcut", and for a URL it is "Web Document".
>
> If there is no built-in support (yet), what is the best way to script the
> creation of a web link file. Should I just store one in a custom property
> and write it out to a file when I want to create it?

The problem I see with storing one of these as a file in a custom
property then saving it on the filesystem with an updated URL, is that
they seem to contain some UUID.  If you list one in a command window
using e.g. more, you will see something like this:

[InternetShortcut]
URL=http://www.google.co.uk/
IDList=
IconFile=http://www.google.com/favicon.ico
IconIndex=1
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2

Maybe you can just update that URL and the other details won't matter.
 I notice that when I pasted the above into Notepad and saved it as a
.url file, that the iconfile being used was an IE icon rather than
Google's favicon.  When I clicked the shortcut file, it still opened
in my default browser (which is not IE).  Still, that may not be
satisfactory.

I don't do much Windows scripting, but I suppose it should be possible
to create one of these Web Document shortcuts using VBScript.  I did a
quick search for you and found some sample code:

http://www.utteraccess.com/forums/printthread.php?Cat=&Board=47&main=1674600&type=thread

This seems to be the bare minimum:

set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Microsoft Web Site.url")
oUrlLink.TargetPath = "http://www.yahoo.com"
oUrlLink.Save


Bernard



More information about the Use-livecode mailing list