Webservice to call a batch file?
I've written a small webservice that all it does is call a batch file on the
server passing along some parameters.
It seems that the batch file (sm.cmd) exits after only executing for a
second or two.
Here is the code
private string CallExecutable(string Path, string Arguments)
string sReturn = "";
Process proc = new Process();
//proc.StartInfo = new
"buildspecs." + sBuildSpec);
proc.StartInfo.FileName = Path;
proc.StartInfo.Arguments = Arguments;
//proc.StartInfo.CreateNoWindow = false;
proc.StartInfo.UseShellExecute = true;
//proc.Exited += new EventHandler(OnExited);
//proc.EnableRaisingEvents = true;
bool bTest = proc.Start();
sReturn = bTest.ToString();
sReturn = "Executable does not exist";
sReturn = ex.Message;
I've tried increasing the time on teh WaitForExit, I've also tried leaving
it blank so that it waits until completetion.
The reason I know it exits after briefly executing is that a log is written
by sm.cmd and it only shows a small bit of processing.
Any ideas on how to fix this?
|All times are GMT. The time now is 09:47 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.