将当前网址生成快捷方式在桌面(仅支持IE)

//安装到桌面
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)