Lập lịch tự động restart service hàng ngày với Scheduler Task on Windows
Bài hướng dẫn sau sẽ hướng dẫn các bạn lập lịch tự động restart lại dịch vụ "MSSQL" hàng ngày
===> Để lập lịch restart lại service hàng ngày thì bạn chọn option:
1. Tạo file restartmssql.bat và cho lệnh restart mssql vào(thay thế tên mssql cho phù họp)
net stop MSSQL$MISASME2022
net start MSSQL$MISASME2022
2. Dùng Task Scheduler để lập lịch
Step 1: Open Task Scheduler ( Control Panel -> Administrative Tools -> Task Scheduler)
Step 2: Create Task
Name the task, description and select security options
Step 4: Create Task - Trigger. Set up scheduled to run the task
The below setting is to schedule the task to run daily at 4.00 AM
Step 5: Create Task - Action.
Trỏ đến file .bat
Step 6: Create Task - Conditions. Leave the default settings
Step 7: Create Task - Settings. Leave the default settings. Click Ok. You may be prompted to enter user account details.
Step 8: Verify the task in Task Scheduler library and test if your account can run the task
https://blog.sqlauthority.com/2007/0...ommand-prompt/