how to create short cut in vb.net.please help me.how to do?
Regards,
Narasiman P
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Posted Jun 22, 2012, 4:33 AM
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 :-
// 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