Hi! I am writing a C# WinForms program that needs to create a shortcut from the shell:appsfolder folder. I am trying to use the IWshRuntimeLibrary, but Visual Studio 2022 marks it as an error, although I have added the reference Windows Script Host Object Model to the project. I have even tried to manually add the DLL interop.iwshruntimelibrary.dll to the project as an asset, but no good. Please help!
IWshRuntimeLibrary is not recognized by Visual Studio
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Sachin SinghRank #66 · 26.2K reputationPosted Oct 5, 2023, 12:50 PM EDT
Have you used delay signing on your project then open VS Command Prompt and run
Sam HobbsRank #107 · 20.5K reputationPosted Oct 5, 2023, 3:14 PM EDT
Probably you can use ShellLinkObject instead.
ShellLinkObject object (Shldisp.h) - Win32 apps | Microsoft Learn
https://learn.microsoft.com/en-us/windows/win32/shell/shelllinkobject-object