The text of this article is not in this database — only its details are. The old site it was published on is gone, but the Internet Archive kept a copy: How to Create Shortcut of Application programatically using C#
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

Istvan NemethPosted May 17, 2012, 4:16 AM
Hi! Very good but I have a problem with it. I have added arguments to the shortcut and when the argument contains special characters (in my case: ->) the .Save method throws exception. Do you know how this can be handled? The Exception: System.IO.FileNotFoundException: The filename, directory name, or volume label systax is incorrect. Thanks
WTF hieditedPosted Mar 1, 2012, 4:37 PMEdited Mar 1, 2012, 4:39 PM
Thank you it's really usefull! :) In Visual studio 2010 you have to make WshShellClass shell = new WshShellClass(); >> WshShell shell = new WshShell();
Jitendra PujhariPosted May 16, 2011, 1:13 AM
thank's
Kalyan kumar AkshinthalaPosted Jan 3, 2011, 11:44 PM
The code which u have given is very good and also very useful.
matsolofPosted Dec 22, 2010, 8:31 AM
I tried the code in Visual Studio 2010 and got these error messages: Error 1: Interop type 'IWshRuntimeLibrary.WshShellClass' cannot be embedded. Use the applicable interface instead. Error 2: 'IWshRuntimeLibrary.WshShellClass' does not contain a definition for 'CreateShortcut' and no extension method 'CreateShortcut' accepting a first argument of type 'IWshRuntimeLibrary.WshShellClass' could be found (are you missing a using directive or an assembly reference?) Error 3: Interop type 'IWshRuntimeLibrary.WshShellClass' cannot be embedded. Use the applicable interface instead. Why?
Vikram chaurasiyaPosted Aug 24, 2010, 6:12 AM
hi