Bat files restart SQL and IIS services, bat restart sqliis
Sqlserver has the automatic backup function, so we need to restart two servers. The following is the restart script named SQL _restart.bat.
Net stop sqlserveragent
Net stop mssqlserver
Net start mssqlserver
Net start sqlserveragent
The SQL Server Agent is a task scheduler and alarm manager. In actual applications and environments, you can define periodic activities as a task, with the help of the SQL Server Agent, you can use the SQL Server Agent to automatically run SQL Server. If you are a system administrator, you can use the SQL Server Agent to notify you of some warning information, to locate problems and improve management efficiency. The SQL Server Agent mainly includes the following components: Job, alarm, and operation.
The following is a restart script named iis_restart.bat.
Restart IIS service
Net stop W3SVC
Net start W3SVC
Cmd
Finally, use windows scheduled tasks to execute the above files.
Start-> Program-> attachment-> System Tools-> Task Plan-> Add a task plan, determined to start every day!