I'm trying to run an external program from MEL using:
This is so I can have maya wait for that to finish it's job before the script continues . However, the program crashes and gives me this error message:
Unhandled Exception: System.IO.IOException: The handle is invalid.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.Console.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
at f3dvCompiler.Program.Main(String args)
If I run it as this however:
system "start C:/folder/program.exe"
The program will run. The only problem is that the MEL script continues on it's way, even though it needs a file that is created from the program. I added a while loop that check for an existing file larger than 0kb, but what ends up happening is my script with move the file at that point, before it has all the information put into it. I will then get a separate file in the original directory that works, but isn't moved.
Any help would be greatly appreciated.