Executing various tasks manually on a UK windows hosting server is a kind of headache. To eliminate manual duties, the Windows server includes a scheduler, which allows you to plan a program to execute at certain times.
Unlike shared hosting, the dedicated server requires more technical skills and time to manage the server tasks. In shared hosting, the web hosting service provider is the one who manages all the server tasks. Automation becomes mandatory when it comes to dedicated servers. Performing tasks manually on a dedicated is not as easy as you think. A simple mistake can mess up things and may damage your data.
Task automation can be performed using two different methods:
- Using the graphical user interface.
- Using the command line.
Scheduling a Task on Windows Server using GUI
- Go to Start >> Programs >> Accessories >> System Tools >> Scheduled Tasks.
- Click on “Add Scheduled Task” and click on “Next.”
- Select the program you wish to run.
- Specify a name for the task you want to schedule.
- Set up date and time options according to your requirements.
- Insert your system password and simply hit the “Finish” button.
Scheduling a Task on Windows Server using Command Line
If you are having access to the command line on your remote server, then the task can be easily automated using the command line interface.
Using a simple command string, you can automate a task through your command line:
- For Hourly Schedule:
schtasks /create /tn "Task Name" /tr "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE" /sc hourly /ru <username> /rp <password>
The above command string will execute the specified program every hour.
- For Daily Schedule:
schtasks /create /tn "Task Name" /tr "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE" /sc daily /st 05:00:00 /ru <username> /rp <password>
The above command string will execute the specified program daily at the specified time.
Note: Make sure you replace “Task Name” with the name of your task and “C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE” with the program path you wish to run every hour or daily at the specified time. You can configure the timings as per your requirements and schedule any program or task to run on your dedicated server.