Create desktop shortcut

Discussion in 'JavaScript' started by hdamis, Oct 11, 2007.

  1. #1
    Dear Friends,
    I have to create desktop a shortcut for some resons for all clients pc's and it works perfectlly without any problem, but I found that I must enable ActiveX for IE ( Tools->Internet Options->Security->Internet->Custom ).and I don't have a domain to do it from one place so could any one tell me how to create a shortcut without checking ActiveX . I need it very well.
    I used this code .
    //////////////////////////////
    function shortcut()
    {

    var WshShell = new ActiveXObject("WScript.Shell");
    strDesktop = WshShell.SpecialFolders("Desktop");
    var oShellLink = WshShell.CreateShortcut(strDesktop + "\\out.url");
    oShellLink.TargetPath = "%%OUT%%" ;
    oShellLink.Save();
    }
    /////////////////////////////
    Thanks,
     
    hdamis, Oct 11, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    You can't.

    And this code will most likely not work on most systems. And if it works, then only on Internet Explorer.
     
    nico_swd, Oct 11, 2007 IP