Start and Stop SQL Server Using a Script
This is a simple CMD script that will start or stop SQL Server. SQL Server can be a memory and processor hog so I usually set my SQL Server startup to Manual and use the script to toggle its running state. You will need to run the script as administrator.
echo off for /F "tokens=3 delims=: " %%H in ('sc query "MSSQLSERVER" ^| findstr " STATE"') do ( if /I "%%H" NEQ "RUNNING" ( net start MSSQLSERVER ) if /I "%%H" NEQ "STOPPED" ( net stop MSSQLSERVER ) ) PAUSE
Hopefully this will be helpful to others…