Error Calling External Script

  • Thread starter Thread starter Amy L.
  • Start date Start date
A

Amy L.

I am getting the following error "No process is associated with this object"
with the below code. Can someone please explain where the problem could be.
The code below is very simple and mostly pulled from the samples is the
docs.

try
{
Process extProcess = new Process() ;
extProcess.WaitForExit() ;
extProcess.StartInfo.FileName = externalScriptFilename ;
extProcess.Start() ;
}
catch( Exception e )
{
Console.WriteLine( "Details: " + e.Message ) ;
}
 
try replace "extProcess.StartInfo.FileName = externalScriptFilename ;"
with "extProcess.StartInfo.FileName = "wscript.exe " +
externalScriptFilename ; "
 
Back
Top