File .exe not recognized as an internal or external command
15 views (last 30 days)
Show older comments
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!
0 Comments
Answers (1)
Swastik Sarkar
on 12 Nov 2024
Moved: Image Analyst
on 13 Nov 2024
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 Comment
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!