Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a web shortcut on user desktop programmatically

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.

like image 321
Renaud Bompuis Avatar asked Feb 12 '09 04:02

Renaud Bompuis


1 Answers

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:

Creating application shortcut in a directory

like image 73
Andrew Ensley Avatar answered Sep 24 '22 14:09

Andrew Ensley