Client Tasks
Client Tasks are actions that run on the client PCs by themselves. A task pairs a moment, such as the end of a session, with an action, such as clearing browser cookies or restarting the PC.
Typical uses:
- Clear cookies and browser data when a customer leaves.
- Close the customer's applications at the end of a session.
- Warn the customer a few minutes before a timed session ends.
- Restart every PC at a fixed time each night.
- Run a cleanup script on demand.
- Shut down a PC that has been idle on the lock screen.
- Run a program only while a PC stands unused and stop it when someone touches the PC.
Where to Find It
Open Settings, then Clients, then the Client Tasks tab. The page heading is Client Session Tasks.
Settings is available to administrators only.
Requirements
Clients need version 5.1.1 or later to receive tasks. The idle triggers need newer clients:
| Trigger | Minimum client version |
|---|---|
| Idle during a session | 5.2.7 |
| Idle on the lock screen | 5.2.7 |
| Idle on the lock screen, stop on input | 5.2.10 |
An older client does not receive these tasks. Its other tasks keep working.
The Task List
Tasks are grouped by trigger, in this order: client start, session start, member login, guest login, session end, session end warning, idle during a session, idle on the lock screen, idle on the lock screen with stop on input, scheduled and manual. A group appears only when it has at least one task. Each group header shows the trigger name, the number of tasks and an info icon that explains the trigger.
Each row shows:
- Up and down arrows. Tasks run in list order within their group. The arrows move a task within its group only.
- The action icon, the task name and a short description. For a script this is the file name. For a program it is the path and arguments. For a web page it is the address.
- At most one timing chip: the warning minutes, the daily time, the delay or the timeout.
- An on and off switch.
- Run now.
- Edit and delete buttons.
Add Task at the top opens an empty task.
Triggers
The When to run box offers these triggers.
| Trigger | When it fires |
|---|---|
| Client start (after boot) | Once when the client starts up, before any session. |
| Session start | When a customer session begins. |
| Member login | When the session is started by a member signed in with an account. Session start tasks still run for them as well. |
| Guest login | When the session is started without a member account, such as a guest or a voucher login. Session start tasks still run for them as well. |
| Session end | When a session ends, on logout or when a timed session runs out. |
| Session end warning | Shortly before a timed session ends. Used only with the Session end warning action. |
| Scheduled (daily) | Every day at the time you set, on the connected clients. |
| Manual (run on demand) | Only when you press Run now, on the connected clients. |
| Idle during a session | A customer session is open and the keyboard and mouse have not been used for the set time. Video playback counts as activity. |
| Idle on the lock screen | The lock screen has had no keyboard or mouse input for the set time. A freshly booted computer also counts. |
| Idle on the lock screen, stop on input | Starts a program when the lock screen has had no input for the set time. The program runs until someone uses the keyboard or mouse or a session starts. |
Actions
The What to do box offers these actions.
| Action | What it does |
|---|---|
| Clear browser cookies | Deletes saved cookies for Chrome, Edge and Firefox. |
| Clear browser session data | Deletes session and local storage for the common browsers. |
| Clear temp folder | Empties the Windows temp folder. |
| Clear downloads folder | Empties the current user's downloads folder. |
| Run script (.bat / .cmd) | Runs an uploaded .bat or .cmd file on the client. |
| Run a program | Launches a program already installed on the client. |
| Open a web page | Opens a web address in the default browser of the PC. |
| Close running apps | Closes the customer's still-running applications. |
| Send window to tray | Sends the client window to the system tray. The customer sees their own desktop and can bring the window back from the tray icon. |
| Restart the computer | Restarts the client PC. |
| Shut the computer down | Shuts the client PC down. |
| Session end warning | Warns the customer before a timed session ends. |
Some pairs are not offered:
- Restart the computer and Shut the computer down are not offered for Session start, Member login or Guest login.
- Send window to tray is offered only for Session start, Member login and Guest login.
- Session end warning always uses the Session end warning trigger. Choosing one sets the other.
- Restart the computer and Shut the computer down are not offered for Idle during a session. The customer may still have paid time left.
- Idle on the lock screen, stop on input offers only Run a program and Run script (.bat / .cmd).
The cleanup actions, scripts and programs run on Windows clients.
Task Fields
| Field | Meaning |
|---|---|
| Name | Required. Shown in the list. |
| When to run | The trigger. |
| Run every day at | Shown for the Scheduled trigger. A time in 24 hour HH:MM format is required. |
| What to do | The action. Hidden for the Session end warning. |
| Delay before running (seconds) | How long to wait after the trigger before the task runs. 0 runs it at once. Allowed range is 0 to 3600. |
| Script file | For Run script. Choose file uploads a .bat or .cmd file to the server. Replace file swaps it. |
| Program path and Arguments | For Run a program. The path is required. |
| Web address | For Open a web page. If you leave out https://, it is added for you. |
| Wait for it to finish | For scripts and programs. On: the client waits and stops the program if it passes the time limit. Off: the client launches it and leaves it running. Scripts start with this on. Programs start with it off. |
| Stop the script if it runs longer than (seconds) | Shown while Wait for it to finish is on. The default is 30. |
| Idle time before running (seconds) | Shown for the idle triggers in place of the delay. Allowed range is 30 to 86400. The default is 300. Any input starts the count again. |
| Mouse tolerance (pixels) | Shown for Idle on the lock screen, stop on input. Mouse movements smaller than this are ignored. Allowed range is 0 to 500. The default is 10. Any key press or click always stops the program. |
| Enabled | Whether the task runs. |
A task that fails, times out or is not supported never stops the other tasks from running.
Idle Tasks
An idle task runs once per idle period. It runs again only after new input and another full idle period. Nothing runs while a session is paused.
The three idle triggers differ in what happens to a program they start:
| Trigger | When the program is stopped |
|---|---|
| Idle during a session | It is not stopped by the idle system. |
| Idle on the lock screen | With Wait for it to finish off, it is stopped when a session or admin mode starts. Input alone does not stop it. |
| Idle on the lock screen, stop on input | It is stopped on a key press, a click or a mouse move past the tolerance. It is also stopped when a session or admin mode starts. Wait for it to finish is not offered because the program is always left running. |
Stopping a program also ends any child processes it started. If the client closes unexpectedly, the program stops with it.
A program started by an idle lock screen task never keeps running into a customer session. Idle lock screen tasks start again only after the lock screen returns.
Scripts and programs run on Windows clients.
Session End Warning
The Session end warning shows a notice on the client before a timed session runs out. It has its own settings:
| Setting | Meaning |
|---|---|
| Warn this many minutes before the end | Required. Must be more than 0. |
| Repeat every minute | After the first warning, warn again at each remaining minute. |
| Show a message and Message | The text on screen. |
| Show a countdown | Shows the time left. |
| Play a tone and Tone | Plays one of the built-in sounds. |
| Say it out loud and Spoken text | The PC speaks the text with its built-in voice. Use {n} in the text to say the current minutes. |
Only one session end warning can be active at a time. A new installation starts with one warning task, set to 5 minutes.
Step by Step
Clean the browser after every session
- Open Settings, Clients, Client Tasks.
- Press Add Task.
- Enter a name, for example Clear browser data.
- Set When to run to Session end.
- Set What to do to Clear browser cookies.
- Press Save in the dialog.
- Repeat for Clear browser session data if you want both.
A task is stored as soon as you press Save in the dialog. It is sent to the connected PCs at once. The Save button of the Settings page is not needed.
Restart every PC at night
- Press Add Task.
- Set When to run to Scheduled (daily).
- Enter the time in Run every day at.
- Set What to do to Restart the computer.
- Press Save.
Shut down PCs left idle
- Press Add Task.
- Set When to run to Idle on the lock screen.
- Enter the time in Idle time before running (seconds).
- Set What to do to Shut the computer down.
- Press Save.
A freshly booted computer counts as idle. A PC can turn off again before a customer arrives if the idle time is short.
Run a program only while a PC is unused
- Make sure the program is installed at the same path on the PCs. File Sync can copy it.
- Press Add Task.
- Set When to run to Idle on the lock screen, stop on input.
- Enter the time in Idle time before running (seconds).
- Set Mouse tolerance (pixels).
- Set What to do to Run a program and enter the path and any arguments.
- Press Save.
The task goes to every connected client. On a PC without the program, the launch fails and its other tasks carry on.
Run a script now
- Add a task with the Manual (run on demand) trigger and the Run script (.bat / .cmd) action.
- Choose the script file and save.
- Press Run now on the task row and confirm.
The task is sent to every connected client.
Notes and Troubleshooting
A scheduled task did not run. The daily time uses the server clock. The server must be running at that time. A run that was missed because the server was off is skipped, not run late. Only the PCs connected at that moment receive the task.
Scheduled and manual tasks run during a session. They are operator actions and run regardless of whether a customer is on the PC. Keep this in mind before scheduling a restart or shutdown.
A delayed task did not run after a session start or end. A delayed session task is dropped if the session changes during the delay. For example, a customer signs in on the PC before a delayed end-of-session restart fires.
An idle task did not start. Check the client version in the Requirements section. Any input restarts the idle count. Nothing runs while the session is paused.
A program on the stop on input trigger stops too easily. Raise Mouse tolerance (pixels). A small bump of the desk can move the mouse past a low value. After it stops, the program waits for the next idle period.
Run now is missing on a row. It is not shown for the Session end warning and for Send window to tray. It is also not shown without full automation.
Client Restrictions block Command Prompt. Scripts that HandyCafe runs as client tasks are not closed by that restriction. See Client Restrictions.