narasiman man

narasiman man

  • NA
  • 0
  • 63.9k

creating short cut in vb.net

Jun 27 2012 2:47 AM

 I send the question how to create a short cut in vb.net using Csharp.

you send the  answer

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

//this creates a folder shortcut

IWshShell wsh = new WshShellClass();
IWshShortcut shortcut = (IWshShortcut) wsh.CreateShortcut (shortcutpathfilename);
shortcut.TargetPath = targetdir;
shortcut.save();


But here 

in the above code Iwshshell it is not defaulty coming in code part.

Why please help me.please send the code.

Rgds,

Narasiman P