I need to kick off a 3rd party java application from a c# .net application. Originally I wanted to do this from an asp.net site but after running into problems with permissions/privileges I moved onto attempting to do it from a windows service since it runs as the system user which I'd hoped would remove my problems. Oh yes and my problems are occuring when trying to run this on a windows 2008 server. All is good in my windows 7 development environment.
Naturally I have scoured these forums and others for answers and nothing I have found has helped so please entertain me.
I have the command I want to run in a batch file and am using the following code to start it.
ProcessStartInfo psi = new ProcessStartInfo(filePathToBatchFile);
psi.Arguments = "arguments for batch file..."
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
psi.RedirectStandardInput = true;
Process p = Process.Start(psi);
I'm running a batch file essentially because I wanted to make sure that something was happening. I have made sure that all the variables and file paths are correct and that the batch file is indeed running. I can get it to do other things like xcopy files around and I can run the command myself from the command line and it works fine. There are no exceptions being thrown and no output from the process. If I changed the paths (to the java binaries, the files that I'm passing to it etc.) to deliberately incorrect ones then it complains.
I have tried running this process as different users, namely the one I can use to log into the server and run the command manually. I have given the service access to the desktop from the services properties menu.
If anyone has any ideas about what is happening here, or even some tips on how I can go about diagnosing this it would be hugely appreciated.