using Windows Script Host

Posted by Axarydax on Stack Overflow See other posts from Stack Overflow or by Axarydax
Published on 2010-02-18T12:44:00Z Indexed on 2010/03/14 3:15 UTC
Read the original article Hit count: 761

Filed under:
|
|

Hello, I am using windows script host for some kind of installer application and I'm creating shortcuts in start menu with it. This problem came up when I switched to x64 environment (win7 ultimate x64+vs2010)

I added a reference to Windows Script Host Object Model (from c:\windows\syswow64\wshom.ocx), it generated Interop.IWshRuntimeLibrary dll.

I added 'using IWshRuntimeLibrary;' to my .cs files, but when I tried to create

WshShell sh = new WshShellClass(); 

it throws an exception:

Could not load file or assembly 'Interop.IWshRuntimeLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

I assume that I would need 64-bit version of that wshom.ocx for this to work, but I don't know what should I try.

Or I'll just dump Windows Script stuff, but I need another way to create start menu shortcuts from .net application. Thanks

© Stack Overflow or respective owner

Related posts about windows-scripting

Related posts about c#