当前位置导航:炫浪网>>网络学院>>网页制作>>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 + ""))
                 {               
                     var link = shell.CreateShortcut(tagFolder + ""); 
                     link.Description = "打开一个程序的快捷方式";          
                     link.TargetPath = "";
                     link.WindowStyle = 3;
                     link.WorkingDirectory = "c:\\blah";           
                     link.Save();                     
                 }            

相关内容
赞助商链接