"The handle is invalid" when running an exe

조회 수: 16 (최근 30일)
KAE
KAE 2019년 10월 29일
편집: KAE 2019년 10월 30일
I would like to run an executable from the Matlab command line. However when I try
system('MyProgram.exe')
I get the error,
Unhandled Exception: System.IO.IOException: The handle is invalid.
When MyProgram.exe is run from the Windows command line, it opens a GUI that you enter commands into.
Any suggestions on what is going wrong here?

채택된 답변

KAE
KAE 2019년 10월 30일
편집: KAE 2019년 10월 30일
Passing along the solution from here in case it helps someone: Due to the popup window that the exe generates, I needed to add an & at the end,
system('MyProgram.exe &')
Then it works fine!

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming Utilities에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by