使用javascript创建快捷方式的简单实例

这篇文章介绍了使用javascript创建快捷方式的简单实例,有需要的朋友可以参考一下

需将站点设为信任站点。

复制代码 代码如下:


             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 = "https://www.jb51.net";
                     link.WindowStyle = 3;
                     link.WorkingDirectory = "c:\\blah";           
                     link.Save();                     
                 }            

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdzsfs.html