What I desire to do is that in a click of a button the user gets to choose executable file to which he wants to create a shortcut.
For example we have the game Doom 3 in the folder "c:\games\doom3\doom.exe"
He would then pick the executable, click on OK, then in the form click on "save", and a shortcut to that executable would appear in the folder "c:\shortcuts\"
I lurked around for a while and found a sample code in how to create a shortcut but I have no idea how I'm going to do it just like I explained above.
WshShell shell = new WshShell();
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(@"D:\shotcut.lnk");
shortcut.TargetPath = Application.ExecutablePath;
shortcut.Description = "Any Description here ";
shortcut.Save();
I also tried this code and it would give an exception on "shortcut.Save", is it because I'm using a 64 bit system?
Thanks in advance.