File .exe not recognized as an internal or external command
이전 댓글 표시
I am trying to run a .bat file which runs an .exe file. The .exe file run a file and print a result. I leave here the text of the .bat file, which runs perfectly if I double-click on it.
ECHO OFF
tpgigm.exe both MODELLOLL15_0.atp MODELLOLL15.lis -R
FYI, the program I am trying to run is ATP, en electromagnetic transient program. If you run the .atp file in the tpgig.exe compiler, you get the simulation results in the .lis file. Both .atp and .lis are readable like a .txt file.
If I try to give Matlab the command:
system('C:\EEUG24\ATPDraw75_Image\ATP\SFK.bat');
It says:
C:\Users\Feder\MATLAB Drive\TESI>ECHO OFF
"tpgigm.exe" it is not recognized as an internal or external command, program or batch file executable.").
And if I try to run
system('C:\EEUG24\ATPDraw75_Image\ATP\tpgigm.exe both MODELLOLL15_0.atp MODELLOLL15.lis -R','-echo');
instead, It gives me problems with ATP itself; it runs in matlab, but it has problems to load the startup file. It's an ATP error inside Matlab.
How can I make "recognisable" for matlab the tpgig.exe file to run the batch?
Thanks for your help!
답변 (1개)
Swastik Sarkar
2024년 11월 12일
이동: Image Analyst
2024년 11월 13일
It seems likely that the batch script is being executed from a directory different from where tpgigm.exe is located. The batch script requires tpgigm.exe to be either in the same directory as the script or added to the Windows Path Variable. Otherwise, the error message
tpgigm.exe is not recognized as an internal or external command, program or batch file executable
will appear.
To resolve this issue, consider changing the directory to where the executable is located before running the script through system command.
댓글 수: 1
Federico
2024년 11월 13일
이동: Image Analyst
2024년 11월 13일
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!