views:

923

answers:

1

There are quite a few resources for programmatically creating .lnk type shortcuts to files and programs on the desktop but I'm wondering how to create a shortcut to a web URL.

From what I can gather, the web URL shortcut is a text file ending in .URL and contains a ini-like definition such as:

[InternetShortcut]
URL=http://www.google.com/

However, it's not enough to just create the file, it seems you also need to change its meta URL properties to include the same link.

Any idea how to create these?

Any sample code from .Net/Perl/batch is welcome.

+3  A: 

You can create .lnk shortcuts to any URI, including web addresses. Just create the shortcut and make the target your web address instead of a file location.

See this other question for how to do it programmatically:

http://stackoverflow.com/questions/234231/how-do-you-create-an-application-shortcut-lnk-file-in-c-or-net

Andrew