MyShortcut = Where the shortcut should point to String deskDir = Environment.GetFolderPath()
![powerhsell create lnk file powerhsell create lnk file](https://www.chubbydeveloper.com/wp-content/uploads/2021/05/image10.png)
IWshRuntimeLibrary.IWshShortcut MyShortcut Create a new instance of WshShellClass private void createShortcutOnDesktop(String executablePath) WorkingDir = shellShortcut.WorkingDirectory Using (var shellShortcut = new ShellShortcut(existingShortcut)) Using (var shellShortcut = new ShellShortcut(newShortcutPath) T.InvokeMember("Save", BindingFlags.InvokeMethod, null, lnk, null) Object lnk = t.InvokeMember("CreateShortcut", BindingFlags.InvokeMethod, null, shell, new object) Object shell = Activator.CreateInstance(t) Var lnk = shell.CreateShortcut("sc.lnk")
![powerhsell create lnk file powerhsell create lnk file](https://www.winhelponline.com/blog/wp-content/uploads/2019/07/bulk-shortcut-path-change.png)
NET 4.0) Type t = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8")) //Windows Script Host Shell ObjectÄynamic shell = Activator.CreateInstance(t)