Add a scheduled task with the AT command. For the use of syntax you can go to window-"Start"-"Run" cmd "-" execute Command "at/" so that the interface will show the syntax of the AT command. Let's explain how to get the server to start Apache and MySQL regularly:
1, in the C: the directory to create a new Autostartserver.bat file, and then right-click Edit, the contents of the file set to save as follows:
Copy Code code as follows:
@ECHO off
net stop Apache2
net start apache2
net stop MySQL
net start MySQL
Description: Above the apache2 with MySQL for the service name.
2, "Start"-"Run" cmd "-" Execute Command "at 04:00 C:\autostartserver.bat"
That way, the system automatically restarts Apache and MySQL 4 o'clock in the morning every day.
Description: 04:00 Restart time, c:\autostartserver.bat as the first step of the bat file address
Sometimes the middle requires a certain interval of time, can be implemented through the following code.
Copy Code code as follows:
net stop SQLServerAgent
net stop MSSQLServer
Echo.wscript.sleep (50000) >s.vbs
cscript//nologo S.vbs
Del S.vbs
NET start MSSQLServer
Net start SQLServerAgent
The above is an interval of 50 seconds (50000 milliseconds) to start the SQL Server service, because SQL Server shutdown and startup requires a certain amount of time, MySQL does not need a time interval.