Hello,I am trying to use taskkill in matlab to kill the excel files which are running .But ,'taskkill' is not getting recognised as an internal or external command in Matlab.Could anyone please help me with this. :

조회 수: 8 (최근 30일)
Code: system('taskkill \F \IM EXCEL.EXE')
  댓글 수: 1
Eddie Irvine
Eddie Irvine 2021년 4월 4일
편집: Eddie Irvine 2021년 4월 4일
Hi,
system('taskkill /F /IM EXCEL.EXE')
and
system('taskkill /F /IM SCREENSKETCH.EXE') (for Snip & Sketch application in Windows10)
work smoothly in my Windows10-64bit computer,
with MATLAB2020a.
Two occurance of '\' in the above comment by Adam Danz is replaced with '/' and this avoided the error such as:
ERROR: Invalid argument/option - '\F'.
Type "TASKKILL /?" for usage. )
With kind regards,
EI

댓글을 달려면 로그인하십시오.

답변 (1개)

Sam
Sam 2017년 10월 22일
!taskkill -f -im EXCEL.exe
  댓글 수: 2
Dima
Dima 2019년 2월 27일
Hi Sam,
how are you? I tried this code and it closes all instance of excel - can it close the last one only? I have a bunch of excel ghost processes after using excel link
Adam Danz
Adam Danz 2020년 1월 24일
Scott 's answer moved here as a comment.
worked perfectly. Watched the Microsoft Excel process being dumped after running !taskkill. Thank you for responding, Sam, I've been looking for this solution for at least 5 years.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Downloads에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by