Reputation: 5765
I have a web site that includes code to move data between databases, generate Office documents, etc. I also have a need to duplicate some of this work in batch. Where they overlap, I've had to code things two different ways -- one for the web site (using server-side vb.net) and one for batch (using vbscript). I know you can run batch from vb.net. I'd like to do the opposite -- from batch I'd like to access some code that I've already written using vb.net classes, web.config, and Office interop assemblies. I tried some of this in PowerShell, but it took 45 minutes to generate a report that runs in 20 seconds through the web interface. Is it possible to do what I want in vbs batch?
Upvotes: 1
Views: 568
Reputation: 172448
The easiest way is probably to create a (VB.NET) EXE project, reference the (web) DLL you've written, call the code of your DLL and run the EXE locally instead of a batch file.
Using VBScript would be more difficult, since VBScript can only access COM DLLs, not .NET DLLs. Thus, you'd have to expose your .NET DLL as COM objects (this can be done, but it requires some additional work) to automate it via VBScript.
Upvotes: 1