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 Comment

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!

Sign in to comment.

Answers (1)

  1. Show the command you're dispatching...
  2. 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

Asked:

on 5 Jun 2017

Edited:

dpb
on 6 Jun 2017

Community Treasure Hunt

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

Start Hunting!