First post here.
I have come out with a script to stop few windows services:
Code: Select all
ECHO OFF
CLS
:MENU
ECHO.
ECHO ....................................................
ECHO Would you like to stop unnecessary Windows services?
ECHO ....................................................
ECHO.
ECHO 1 - Yes
ECHO 2 - No
ECHO.
SET /P M=Type Y or N, then press ENTER:
IF %M%==Y GOTO STOP01
IF %M%==N GOTO EXIT
:STOP01
net stop "Schedule" /y
net stop "FwcAgent" /y
net stop "SamSs" /y
net stop "ShellHWDetection" /y
net stop "MSSQL$SQLEXPRESS" /y
net stop "Schedule" /y
net stop "LMHosts" /y
net stop "vvdsvc" /y
net stop "ALG" /y
net stop "BITS" /y
net stop "usnjsvc" /y
net stop "SSDPSRV" /y
net stop "TapiSrv" /y
net stop "TermService" /y
net stop "IAANTMON" /y
net stop "EvtEng" /y
net stop "RegSrvc" /y
net stop "S24EventMonitor" /y
net stop "PolicyAgent" /y
net stop "TrkWks" /y
net stop "WmiApSrv" /y
net stop "MBAMService" /y
:EXIT
exit
GOTO MENU
What I need now is a line of text below showing "Services will be automatically stop after X seconds..."
And the X keeps ticking down until it reaches 0. Let's have 5 seconds countdown for this case.
When it reaches 0, I want the program to automatically select Y (Yes) and run the stopping of services.
How do I do this?
Thanks.
Regards
HK