ProcessUtils.function - get Exit Code???

Do any of the ProcessUtils.function allow you to get back the exit code of the process you spawn/execute? Example?

Thanks,
Paul
CafeFX

Hi Paul,

The SpawnProcess and ShellExecute functions return the .NET Process object, which has many useful functions/members. One is to get the exit code. Here’s a quick, but untested, example:

from System.Diagnostics import *
from Deadline.Scripting import *
...
	myProcess = ProcessUtils.SpawnProcess( "c:\\myApp.exe" )
	myProcess.WaitForExit()
	exitCode = myProcess.ExitCode

Documentation on the .NET Process object can be found here:
msdn.microsoft.com/en-us/library … ocess.aspx

Hope this helps!

Cheers,

  • Ryan

Exactly what I needed. Thanks a bunch!

Gotta get used to this whole idea that IronPython doesn’t have all of Python, but it does have DotNEt! Give and Take…

-Paul