To help keep everything running smoothly, Windows automates many maintenance tasks in the background, including checking for updates and removing temporary files. These rely on the Task Scheduler, a tool which can also be customised with scripts of your own. 

At its most basic, this can be used to open certain apps when specific criteria are met. But you can get more advanced, with the ability to run almost any command you’d run in Windows PowerShell. 

We’re using a Windows 11 device for the purposes of this tutorial, but it’s the exact same method on Windows 10. 

How to automatically open any app in Windows

The app will now open at the specific time, or as soon as possible after your device is turned on. This can be repeated as many times as you’d like. 

How to automatically run a command in Windows

If you’re willing to put in some time and effort, you can set Windows to carry out more complex tasks automatically. In theory, any command that works in Windows PowerShell can be automated. 

Here, we’ll be setting Windows to automatically lock your device at 6pm each workday. This is an easy way to signal that you should stop working, without risking losing any of your work. 

Follow steps 1-5 as above 

Right click your created folder, then choose ‘Create Task…’

Give your file a meaningful name. In this example, we’re going for ‘Windows auto-lock’ 

Under ‘Security options’, make sure the admin account is selected to run the task and decide whether you want it to just run when logged in or not 

Choose the ‘Triggers’ tab from the top of the window, then select ‘New’

From the drop-down next to ‘Begin the task’, choose ‘On a schedule’ (unless you’re going for something more complicated)

As with the basic command, specify a start time and frequency 

Choose any of the advanced settings you’d like, then click ‘OK’

Choose the ‘Actions’ tab from the top of the window, then click ‘New…’ 

Make sure ‘Start a program is selected’, then enter your chosen script. To lock the device, it’s ‘rundll32. exe’. For many other commands, choose ‘powershell’ 

In the box next to ‘Add arguments’, add the rest of the command you’d usually enter into Windows PowerShell. In this example, it’s ‘user32. dll,LockWorkStation’ 

Click ‘OK’, then ‘OK’ again to save it 

How to make Windows 11 easier to use on tabletsHow to downgrade from Windows 11 to Windows 10How to fix a laptop that won’t turn on

As the resident expert on Windows, Senior Staff Writer Anyron’s main focus is PCs and laptops. Much of the rest of his time is split between smartphones, tablets and audio, with a particular focus on Android devices.