Administration
Background tasks

Configuring Windows Task Scheduler

11min

Windows Task Scheduler is a component of the Windows operating system. It is used to run certain scripts on the server at the right time, on a schedule.

Starting with version 5.1.0 there is a special script which is responsible for running the background tasks:

Shell


It can be run manually or configured to run on a schedule using Windows Task Scheduler.

We recommend that you first check how the script works in the manual mode. To do this, run the following script at the Windows command prompt:

Shell


The script will write information to its log file:

Shell


💡 Make sure that the user you are running the script from has write permissions to the logs folder

Configuring Windows Task Scheduler

Let’s configure the Windows Task Scheduler to execute a script every single minutes.

Open the task scheduler by pressing the Win + R keyboard shortcut and enter taskschd.msc:

Document image




The scheduler window will appear:

Document image




On the panel on the right, select the "Create task" command. The task creation window will appear. Enter a name and description:

Document image


After that, choose how often you want to start the process by creating a new trigger on the "Triggers" tab:

Document image


Set the task to be performed every minute:

Document image




Create a new action on the Actions tab:

Document image


Specify the path to the php.exe (version 8.0) executable file used on your system.

Document image




Add arguments:

Shell


Start in

Shell


Click "Ok". The scheduler will launch the script in 1 minute, the result of its work can be seen in the log file. You can also select the created task and start it immediately:



Document image


💡 We recommend deleting the log file before starting the scheduler for the first time.

Testing out and troubleshooting

Go to Passwork under the administrator and open the Background tasks page.

If you see a message that the scheduler is not configured, runtime errors can be found in the log file:

Shell


Windows Task Scheduler Logs

You can view the scheduler log in the Event Viewer in Windows by the path "Application and Services logs → Microsoft → Windows → TaskScheduler → Operational"

Document image