Created
March 19, 2011 08:36
-
-
Save rochefort/877337 to your computer and use it in GitHub Desktop.
kill the rails process for windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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