3/12/2008

bat 파일로 서비스 실행시키기

출처: Blog 마음 가는 대로
참고: Blog 사용자 문자열 입력받기

@echo off
setlocal
:: str 변수 초기화
set str=

:LOOP
set /p str=VMWare 서비스 - 실행(y), 종료(n):
REM echo 방금 입력하신 문자열은 %str% 입니다.

if "%str%" == "y" goto START
if "%str%" == "n" goto STOP
goto LOOP

:START
net start "VMware Authorization Service"
net start "VMware DHCP Service"
net start "VMware NAT Service"
net start "VMware USB Arbitration Service"
goto END

:STOP
net stop "VMware Agent Service"
net stop "VMware Authorization Service"
net stop "VMware DHCP Service"
net stop "VMware NAT Service"
net stop "VMware USB Arbitration Service"
goto END

:END
endlocal
@echo on

댓글 없음: