Created
October 23, 2012 12:49
-
-
Save ivanrad/3938566 to your computer and use it in GitHub Desktop.
Stop Windows service
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
@echo off | |
rem Stop Windows service | |
if _%1==_ goto help | |
for /f "tokens=2" %%i in ('sc query^|findstr /i /r "DISPLAY_NAME:.*%1"') do ( | |
sc stop %%i | |
) | |
goto die | |
:help | |
echo usage: %0 [service_name_regex] | |
echo; | |
:die |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment