I have a C# COM object in a dll that I have registered using regasm.exe. I do a createObject on the COM object and call methods on the object in a vbs script run with cscript.
If I run this on the command line it all works properly, creates the object calls the method via com.
cscript.exe c:\mypath\myvb.vbs argument
I now am trying to run this same command from C#. I use the System.Diagnostics.Process methods
ProcessStartInfo si = new ProcessStartInfo();
si.Filename = "cscript.exe";
si.Arguments = "c:\mypath\myvb.vbs argument";
Process exe = ProcessStart(si);
...
When I run this way I get the 0x80070002 error , which is basically a file not found error. I dont understand why it is different from C# to the command line.
Edit - More Info
I am running on a 64bit OS. The C# COM dll was built with "AnyCPU" . I used the 64bit regasm. The cscript I used was from c:\windows\system32 so it was the 64 bit version.
From the command line if I deliberately use the 32 bit version of cscript I also get the 0x80070002 error. This leads me to suspect the problem from c# is related, but I still don't get it.