zoukankan      html  css  js  c++  java
  • 使用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();                     
                     }            
                
  • 相关阅读:
    4.23计算机网络
    CF436F Banners
    CF1467C Three Bags
    LG P3247 [HNOI2016]最小公倍数
    LG P5473 [NOI2019] I 君的探险
    LG P3261 [JLOI2015]城池攻占
    LG P4149 [IOI2011]Race
    LG P3181 [HAOI2016]找相同字符
    SP7258 SUBLEX
    SP1811 LCS
  • 原文地址:https://www.cnblogs.com/xiaoko/p/495626.html
Copyright © 2011-2022 走看看