Skip to content

Instantly share code, notes, and snippets.

@ivanrad
Created October 23, 2012 12:49
Show Gist options
  • Save ivanrad/3938566 to your computer and use it in GitHub Desktop.
Save ivanrad/3938566 to your computer and use it in GitHub Desktop.
Stop Windows service
@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