How to exit CMD windows after calling Raven.exe inside a loop in a MATLAB code?
Show older comments
Each time I run the code,for each part of the loop, while calling Raven.exe, a CMD window opens and not close automatically. I ended up got a lot of CMD windows. How can I close the CMD windows using the MATLAB code automatically after each run?
1 Comment
Aishwarya Mittal
on 5 Jun 2017
Create a file with following content and name it 'killtask.bat'
@echo off
taskkill /F /IM Raven.exe
exit
Run it after the task is over by using system() function
I've not tested it so let me know if it doesn't work!
Answers (1)
- Show the command you're dispatching...
- Build a .bat file that runs the program instead of dispatching the program itself:
rem raven.bat
rem contains
@echo off
raven
exit
Of course, proper environment must be set, etc., etc., as well as any parameters needed passed/embedded in the batch file as necessary. The above is the outline...
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!