How to kill process that may not exist on prebuild step in Visual studio?

前端 未结 1 1394
礼貌的吻别
礼貌的吻别 2020-12-31 05:15

Problem is if this process doesn\'t exist, build fails. I try to write something like this

tasklist /nh /fi \"imagename eq XDesProc.exe\" | find /i \"XDesPro         


        
相关标签:
1条回答
  • 2020-12-31 05:15

    You could use a conditional test on the PID to avoid this:

      taskkill /f /fi "pid gt 0" /im xdesproc.exe
    
    0 讨论(0)
提交回复
热议问题