How to exit CMD windows after calling Raven.exe inside a loop in a MATLAB code?
显示 更早的评论
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 个评论
Aishwarya Mittal
2017-6-5
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!
回答(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...
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!