For many people, a laptop or desktop PC is an indispensable tool. Whether it’s getting work done, keeping in touch with family and friends or switching off at the end of a long day, a device running Windows can do it all.
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
- Time to complete: 5 minutes
- Tools required: A Windows device and app you’d like to open automatically
Open the Task Scheduler app
Anyron Copeman / Foundry
The easiest way is to search for it via the search bar next to the Start menu. But it’ll also be in any lists of installed apps. Once open, it’ll look like the screenshot above.
Create a new folder
Anyron Copeman / Foundry
Right-click ‘Task Scheduler Library’ in the left pane, then choose ‘New Folder…’. Give it a meaningful name and hit enter.
Create new ‘Basic Task’
Anyron Copeman / Foundry
Double-click the ‘Task Scheduler Library’ folder to expand it, then double-click your newly created folder to select it. Right-click anywhere in the blank table and choose ‘Create Basic Task…’.
Give the task a meaningful name
Anyron Copeman / Foundry
In the ‘Name’ field, type something of your choosing – in this example, it’s ‘File Explorer launcher’. Then, click ‘Next’.
Choose task frequency
Anyron Copeman / Foundry
From the next screen, choose how often you want the task to run. There are seven options, although ‘when a specific event is logged’ requires extra technical knowledge. Once selected, click ‘Next’ again.
Choose a start time and how often it recurs
Anyron Copeman / Foundry
Select a specific time and date using the calendar. Then type how often you want it to repeat. In this example, you’d type a ‘1’ here for every day. Once complete, click Next once more.
Make sure ‘Start a program’ is selected
Anyron Copeman / Foundry
There are three options here, but sending an email and displaying a message are no longer supported by Microsoft. They may still work, but opening a program is much simpler and does still work.
Select the app you want to open
Anyron Copeman / Foundry
Click the ‘Browse…’ button next to ‘Program/script’ box and locate the .exe file for the specific app you want to open. The ‘System32’ app will launch by default, but the file you’re looking for might be within ‘Windows’ instead. There’s no need to add optional fields, so just click ‘Next’.
Review and finish
Anyron Copeman / Foundry
Check everything looks right in this summary screen. If you’re satisfied it does, click ‘Finish’.
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…’
Anyron Copeman / Foundry
- 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
Anyron Copeman / Foundry
- Choose the ‘Triggers’ tab from the top of the window, then select ‘New’
Anyron Copeman / Foundry
- 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’
Anyron Copeman / Foundry
- 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’
Anyron Copeman / Foundry
- Click ‘OK’, then ‘OK’ again to save it