Bash 脚本:在重新执行之前杀死实例

Bar*_*ney 0 windows powershell command-line process batch-file

我有一个批处理脚本,用于快速启动我的开发环境。看起来像这样

:: Update checkout
git pull
:: Compile code with Maven
call mvn clean install -Pui
:: File for a program called Free File Synch which persists changes from one
:: part of the file system (my checkout) to another (the static cache generated
:: by Maven)
source-to-server.ffs_real

:: Navigate to the front-end
cd .\target\frontend
:: Serve to localhost
python -m SimpleHTTPServer 80
Run Code Online (Sandbox Code Playgroud)

我想要做的是终止由source-to-server.ffs_real(它被称为RealtimeSync.exe)启动的进程——换句话说,在设置之前包括一种拆卸。在其他地方我已经阅读过pkillkillall但这些在我的 PATH 中不可用。当然必须有一个windows本机的方式来做到这一点?

Vla*_*čík 7

优美:

  • taskkill /IM RealtimeSync.exe

强制:

  • taskkill /F /IM RealtimeSync.exe
  • wmic process where name="RealtimeSync.exe" delete
  • wmic process where name="RealtimeSync.exe" call terminate