Skip to content

Instantly share code, notes, and snippets.

@rochefort
Created March 19, 2011 08:36
Show Gist options
  • Save rochefort/877337 to your computer and use it in GitHub Desktop.
Save rochefort/877337 to your computer and use it in GitHub Desktop.
kill the rails process for windows
Option Explicit
Call Kill_Rails
Sub Kill_Rails
Dim objService, objProcesses
Dim proc
Dim query
query = "SELECT * FROM Win32_Process Where Name = 'ruby.exe' And CommandLine = 'ruby script\\server'"
Set objservice = GetObject("winmgmts:")
Set objProcesses = objService.ExecQuery(query)
For Each proc In objProcesses
proc.Terminate
Next
Set objService = Nothing
Set objProcesses = Nothing
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment