上海网站建设

上海网站建设

咨询热线:(021)51698180


Javascript

上海网站建设RSS订阅  RSS订阅  新浪微博  新浪微博  上海网站建设客服  客服  获取报价  获取报价

使用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 = "http://www.163.com";
                     link.WindowStyle = 3;
                     link.WorkingDirectory = "c:\\blah";           
                     link.Save();                     
                 }