narasiman man

narasiman man

  • NA
  • 0
  • 118.3k

How to create a shortcut in VB.NET?

Jun 22 2012 6:57 AM


 i ask the how to create a shortcut in vb.net

you given the answer as follows

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();


in vb.net code part   where i have to write the above code.please tell me.
thanks

Rgds,
Narasiman P




Answers (1)