简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM