Web Analytics Made Easy -
StatCounter chreating shortcut to start menu desktop in asp.net - CodingForum

Announcement

Collapse
No announcement yet.

chreating shortcut to start menu desktop in asp.net

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • chreating shortcut to start menu desktop in asp.net

    hello... i am stuck hence being here, when I was working in asp I remember making ws.shelllinks to create shortcuts that could go on the start menu and the desktop to open a webpage or any shortcut

    but now I am using .net i can't find anything that can do this, which is strange because i would have thought .net being more powerful it would be easier to make shortcuts ???

    if anyone could help or guide me in the right direction, i would appriciate it very much..


    many thabnks chris
    <marquee>thanks</marquee>

  • #2
    You do it in client-side (javascript) not server-side, therefore classic ASP or ASP.NET has nothing to do with it. Here's the javascript code for it:
    Code:
    function createShortcut(){
      if (ActiveXObject){
        var WSHShell = new ActiveXObject("WScript.Shell");
        var DesktopPath = WSHShell.SpecialFolders("Desktop");
        var MyShortcut = WSHShell.CreateShortcut(DesktopPath + "\\YourSite.url");
        MyShortcut.TargetPath = WSHShell.ExpandEnvironmentStrings("http://yoursite.com");
        MyShortcut.Save();
        alert("A shortcut to my site now exists on your Desktop.");
      }
      else alert("Sorry, this is IE feature only.");
    }
    Glenn
    vBulletin Mods That Rock!

    Comment

    Working...
    X