简体   繁体   English

以编程方式在用户桌面上创建Web快捷方式

[英]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. 有很多资源可以在桌面上以编程方式创建.lnk类型的文件和程序快捷方式,但我想知道如何创建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: 从我可以收集的内容来看,Web URL快捷方式是以.URL结尾的文本文件,包含类似ini的定义,例如:

[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. 但是,仅仅创建文件是不够的,似乎您还需要更改其元URL属性以包含相同的链接。

Any idea how to create these? 知道如何创建这些?

Any sample code from .Net/Perl/batch is welcome. 欢迎来自.Net / Perl / batch的任何示例代码。

You can create .lnk shortcuts to any URI, including web addresses. 您可以为任何URI创建.lnk快捷方式,包括Web地址。 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 在目录中创建应用程序快捷方式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 以编程方式为桌面“快捷方式”创建快捷键组合 - Programmatically create shortcut keys combo for desktop “shortcut” 在 Windows 桌面上创建快捷方式图标 - Creating a shortcut icon on the Windows desktop 通过组合键创建桌面快捷方式? - Creating a desktop shortcut out of a key combination? 如何在用户桌面上创建计算机的快捷方式 - How to create shortcut to Computer on the user's desktop 在SCCM 2007部署后,PowerShell脚本无法创建桌面快捷方式吗? - Powershell Script not creating shortcut to desktop after SCCM 2007 deployment? 桌面快捷方式打开新的 chrome web 页面作为新选项卡 - Desktop Shortcut to open new chrome web page as new tab 桌面上的 Ionic PWA 快捷方式 - Ionic PWA shortcut on desktop 是否可以以编程方式更改用户的屏幕保护程序和/或桌面背景? - Is it possible to programmatically change a user's screen saver and/or desktop background? 在Windows 2008上以编程方式创建漫游用户配置文件 - Creating roaming user profiles programmatically on Windows 2008 某些用户操作更改了链接href后,从Chrome到桌面的拖放链接无法创建正确的桌面快捷方式 - Drag&dropping link from Chrome to desktop does not create a correct desktop shortcut after the link href was changed by some user action
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM