Skip to content

How to create short cut in vb.net

Asked Jun 22, 2012, 12:11 AM EDT1 answer
Share
LinkedInX
 how to create short cut in vb.net.please help me.how to do?

Regards,

Narasiman P

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    You will get the idea from here.

    Here is some C# code to create a shortcut to a folder. These are actually .lnk files which are handled in a special way by Windows Explorer.

    First include a reference to C:\Windows\System32\wshom.ocx

    Second, include the following using statement :-

    using IWshRuntimeLibrary;

    Third, Here is the code :-


    Code
    // This creates a Folder Shortcut
    IWshShell wsh = new WshShellClass();
    IWshShortcut shortcut = (IWshShortcut) wsh.CreateShortcut (shortcutpathfilename);
    shortcut.TargetPath = targetdir;
    
    shortcut.Save();

    Source  : http://alquistconsulting.blogspot.in/2006/12/create-lnk-file-in-c.html
    0