Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've got a batch script I use to jump start my development environment. It looks like this

:: 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

What I'd like to do is kill the process kicked off by source-to-server.ffs_real (it's called RealtimeSync.exe) — in other words include a kind of teardown before the setup. Elsewhere I've read about pkill and killall but these aren't available in my PATH. Surely there must be a windows native way of doing this?

share|improve this question
1  
Are you using bash or powershell? Windows or a *nix flavor? Is this bash on a windows box? pkill and killall are Unix commands. –  terdon Jul 25 '13 at 16:38
    
Windows, using Powershell. I've got mingw32, ruby, python, and some of the *nix-like commands via git bash. Sorry, I realise my typo — I meant 'batch', not 'bash'. –  Barney Jul 25 '13 at 16:43

1 Answer 1

up vote 0 down vote accepted

Graceful:

  • taskkill /IM RealtimeSync.exe

Forced:

  • taskkill /F /IM RealtimeSync.exe
  • wmic process where name="RealtimeSync.exe" delete
  • wmic process where name="RealtimeSync.exe" call terminate
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.