需將站點設為信任站點。
復制代碼 代碼如下:
var fso = new ActiveXObject("Scripting.FileSystemObject");
var shell = new ActiveXObject("WScript.Shell");
var tagFolder = "c:\\Temp";
if(!fso.FolderExists(tagFolder ))
{
fso.CreateFolder(tagFolder);
//alert("Create success!");
}
if(!fso.FileExists(tagFolder + "\\eip.lnk"))
{
var link = shell.CreateShortcut(tagFolder + "\\eip.lnk");
link.Description = "打開一個程序的快捷方式";
link.TargetPath = "http://www.jb51.net";
link.WindowStyle = 3;
link.WorkingDirectory = "c:\\blah";
link.Save();
}