Copied file c:\windows\system32\wshom.ocx somewhere I have write access to.
Ran tlbimp for that file and got IWshRuntimeLibrary.dll
tlbimp wshom.ocx
Output:
Microsoft (R) .NET Framework Type Library to Assembly Converter 4.8.3928.0
Copyright (C) Microsoft Corporation. All rights reserved.
TlbImp : warning TI3002 : Importing a type library into a platform agnostic assembly. This can cause errors if the type library is not truly platform agnostic.
TlbImp : Type library imported to IWshRuntimeLibrary.dll
Comments
AFAIK there is no NuGet for this.
How I did it for
LINQPad 8 x86/x64 .NET 9
Ran
Developer Command Prompt for VS
.Copied file
c:\windows\system32\wshom.ocx
somewhere I have write access to.Ran tlbimp for that file and got
IWshRuntimeLibrary.dll
Output:
IWshRuntimeLibrary.dll
:Created new script:
Pressed
F4
>Additional References
>Add / Browse...
Ran test script.
You might also need to pay attention to bitness. Also you might have to specify STAThread attribute for
Main
.Thx i2van, it works perfectly.