How to Create Task to Run App or Script at Logon in Windows 10
The Task Scheduler enables you to automatically perform routine tasks on a chosen computer. With this service, you can schedule any program to run at a convenient time for you or when a specific event occurs. Task Scheduler does this by monitoring whatever criteria you choose (referred to as triggers) and then executing the tasks when those criteria are met.
See also:
- About the Task Scheduler | Microsoft Docs
- Starting an Executable When a User Logs On | Microsoft Docs
This tutorial will show you how to create a task in Task Scheduler to run an app or script at logon for specific or all users in Windows 7, Windows 8, and Windows 10.
This task will only run when a user signs in at startup or after signing out.
This task will not run if a user is already signed in, and the user signs back in when switching users or from locking the computer.
You must be signed in as an administrator to create a task to run at logon for all users or specific users other than your account.
If you are signed in as a standard user, you will only be able to create a task to run at logon for only your account.
Here's How:
1 Press the Win + R keys to open the Run dialog, type taskschd.msc into Run, and click/tap on OK to open Task Scheduler.
2 Click/tap on Task Scheduler Library in the left pane of Task Scheduler, and click/tap on Create Task in the right Actions pane. (see screenshot below)
3 In the General tab, type a name (ex: "Run at logon") you want for this task, and type an optional description of the task if wanted. (see screenshot below)
4 In the General tab, click/tap on the Change User or Group button. (see screenshot below)
If you are currently signed in as a standard user, skip this step, and go to step 8 below instead.
5 Click/tap on the Advanced button. (see screenshot below)
6 Perform the following steps to select a user or group you want to run this task as: (see screenshot below)
A) Click/tap on Find Now.
B) Select a specific user name or group you want to use.
If you want to have the task run for all users, then you would want to select the Users group.
C) Click/tap on OK.
7 Click/tap on OK. (see screenshot below)
8 Select Windows 10 in the Configure for drop menu. (see screenshot below)
9 Click/tap on the Triggers tab, and click/tap on New. (see screenshot below)
10 Do step 11 (any user) or step 12 (specific user) below for how you want to run the task for.
You would want to use the exact same user or group you used in step 6.
You must be signed in as an administrator to have Any user available.
If you want to run the task for all users, you would want to use Any user.
If you want to run the task for only a specific user, you would want to use Specific user.
If you are signed in as a standard user, you will only be able to use Specific user for your user name.
A) Select At log on in the Begin the task drop menu. (see screenshot below)
B) Select (dot) Any user.
C) Click/tap on OK, and go to step 13.
A) Select At log on in the Begin the task drop menu, select (dot) Specific user, and click/tap on Change User. (see screenshot below)
B) Click/tap on the Advanced button. (see screenshot below)
C) Click/tap on Find Now, select the user name (ex: "Brink2") you want, and click/tap on OK. (see screenshot below)
D) Click/tap on OK. (see screenshot below)
E) Click/tap on OK, and go to step 13. (see screenshot below)
13 Click/tap on the Actions tab, and click/tap on New. (see screenshot below)
14 Perform the following steps to specify the task to run an app or script: (see screenshots below)
A) In the New Action dialog, select Start a program in the Action drop menu.
B) In the New Action dialog, click/tap on the Browse button.
C) In the Open dialog, navigate to and select the app (ex: "cmd.exe") or script file (ex: .ps1, .bat, .reg, etc...), and click/tap on Open.
D) In the New Action dialog, you can add any arguments you want. For example, when opening a command prompt (cmd.exe) and run a command (aka: argument).
E) In the New Action dialog, click/tap on OK when finished.
14 Click/tap on the Conditions tab, check or uncheck (recommended) the Start the task only if the computer is on AC power box for what you want, and click/tap on OK. (see screenshot below)
15 You will now see this new task (ex: "Run at logon") listed in the Task Scheduler Library. (see screenshot below)
You can right click on this task to perform actions such as Disable/Enable, Delete, or Properties to edit.
16 You can now close Task Scheduler if you like.
That's it,
Shawn Brink
Related Tutorials
- How to Add, Delete, Enable, or Disable Startup Items in Windows 10
- How to Create Elevated App Shortcut without UAC Prompt in Windows 10
- How to Export a Task from Task Scheduler in Windows
- How to Import a Task to Task Scheduler in Windows