Skip to content

Instantly share code, notes, and snippets.

@taka2
Created June 9, 2010 05:56
Show Gist options
  • Select an option

  • Save taka2/431117 to your computer and use it in GitHub Desktop.

Select an option

Save taka2/431117 to your computer and use it in GitHub Desktop.
@echo off
set SERVICE_NAME=Themes
REM --------------------------------------------------
REM サービスが既に起動しているかどうかチェック
REM --------------------------------------------------
net start | findstr %SERVICE_NAME%
if %ERRORLEVEL% == 0 goto error10
REM --------------------------------------------------
REM サービスを起動
REM --------------------------------------------------
net start %SERVICE_NAME%
REM --------------------------------------------------
REM サービスが起動したかどうかチェック
REM --------------------------------------------------
net start | findstr %SERVICE_NAME%
if %ERRORLEVEL% == 1 goto error20
goto end
:error10
exit /b 10
goto end
:error20
exit /b 20
goto end
:end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment