Question

The easiest way to think of my question is to think of a single, simple unix command (albeit, this is for windows) and I need progmatic access to run it.

I have a single command-line based executable that performs some unit of work. I want to call that executable with the .net process library, as I can do with any other executable.

However, it dawned on me that there is potential for the dll to become useless or break with unintended updates to the executable or a non-existant executable.

Is it possible to run the executable from the Process object in the .net framework, as I would an external executable file?

Was it helpful?

Solution

No, you can't execute it directly. You could probably unpack it to a temporary directory and execute it from there.

OTHER TIPS

I found an article that has some sample code to what @garretmagin says:

https://web.archive.org/web/20081229032509/http://www.cs.nyu.edu/~vs667/articles/embed_executable_tutorial/

Is this where PInvoke can help?

Depending on the functionality of the command line program you want to run, it might be possible to duplicate the functionality in PowerShell, where you can embed the PowerShell runtime in your .NET application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top