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
You could use a conditional test on the PID to avoid this:
taskkill /f /fi "pid gt 0" /im xdesproc.exe