Last post Apr 13, 2012 04:50 PM by bbcompent1
Apr 10, 2012 04:50 PM|wsyeager36|LINK
I have a large existing application where I need to call a console app from a code behind page.
I know how to do the above, but what I need help with is the FileName property for the ProcessStartInfo object.
The applciation has many folders all with executables and I want to make sure I am coding the correct path to the exe I want executed.
On my local machine, the specific exe I want executed is below.
How would I code it using server.maptpath? I'm pretty sure that something must be place between the "\" and "EmailDistributor.exe" to get to the right application.
Apr 10, 2012 05:22 PM|bbcompent1|LINK
Running a console app from a web app is handeld in code behind as
Apr 10, 2012 06:38 PM|wsyeager36|LINK
Apr 10, 2012 06:44 PM|bbcompent1|LINK
Ok, if your console app lives under the web folder structure then just call out to it like you would a normal web folder:
Apr 10, 2012 06:48 PM|nirman.doshi|LINK
you can pass the path, depending upon the relativity of folder paths between your page and EXE.
Orelse, you can also give hardcoded path as suggested by bbcompoent1
In case, if they are in very same path then following should work:
Apr 10, 2012 07:06 PM|wsyeager36|LINK
Apr 10, 2012 07:15 PM|bbcompent1|LINK
If the console application is outside the web root, you're either going to have to hard code the path or you'll need to create a web folder that points at the console apps home folder.
Apr 11, 2012 12:55 PM|wsyeager36|LINK
Apr 11, 2012 01:00 PM|bbcompent1|LINK
I think process.start acts like an independent process but just to be sure I would suggest testing it. To be honest, I haven't tested process.start that way.
Apr 13, 2012 04:44 PM|wsyeager36|LINK
I don't suppose that there is a way to pass something back to the web application signifying that the console process has finished executing???
Apr 13, 2012 04:50 PM|bbcompent1|LINK
You will want to start a new thread since this is a different question even though it relates.