JS 添加网页桌面快捷方式的代码

来源:互联网 发布:dbc2000怪物数据库 编辑:程序博客网 时间:2024/06/05 06:58
<script>function toDesktop(sUrl, sName) {try {    var WshShell = new ActiveXObject(“WScript.Shell”);    var oUrlLink = WshShell.CreateShortcut(WshShell.SpecialFolders(“Desktop”) + “\\” + sName + “.url”);    oUrlLink.TargetPath = sUrl;    oUrlLink.Save();} catch (e) {        alert(“当前IE安全级别不允许操作!”);    }}</script></head><body>    <a href=”javascript:void(0);” onclick=”toDesktop(‘http://zl.aisky.net/&#8217;,’小龙驿站’)”>创建快捷方式</a></body>
0 0
原创粉丝点击