试试用进程id来杀
for /f "tokens=2" %%i in ('tasklist^|findstr /i foxmail.exe') do taskkill /pid %%i
上面这句是写在批处理用的,如果在cmd窗口直接运行测试把所有双%%换成单%即可。
for /f "tokens=2" %i in ('tasklist^|findstr /i foxmail.exe') do taskkill /pid %i
把"D:\Program Files\tencent\Foxmail.exe"改为
start "" "D:\Program Files\tencent\Foxmail.exe"就行了
直接打开程序,批处理会一直等待改程序运行完成才进行下一句.
用系统自带的ntsd 试试呢?
ntsd -c q -pn foxmail.exe
ntsd简介:
ntsd.exe是Microsoft Windows 2000(Microsoft Windows XP)系统自带的用户态调试工具。可用它结束掉除System、SMSS.EXE、CSRSS.EXE以外的所有进程。该程序经常被病毒利用,用来强制结束杀毒软件进程。
详细介绍请参阅:百度百科: ntsd.exe
进程名是不是写错了?