Task Scheduler is one of the best utilities of Windows 10, allows you to create tasks and perform them at a scheduled time. From open an app like Notepad to executing PowerShell scripts, you can do everything with Task Scheduler’s help.
Create a scheduled task with PowerShell
To use PowerShell to create a scheduled task on Windows 10, follow these steps- Let’s check out the detailed version of these steps. At first, you have to open Windows PowerShell with administrator privileges. For that, search for “powershell” in the Taskbar search box, and click on the respective Run as administrator button. If the UAC prompt appears, click the Yes button. Once the PowerShell screen is visible, enter the following command- Do not forget to replace the app-path with the original path of the app you want to run. For example, if you want to open Notepad, enter notepad.exe. If you want to open Google Chrome on a 64-bit Windows 10 computer, enter the following path- The entire command will look like this-
In case you want to execute a PowerShell script, you have to use -argument and specify the script. In that case, the command will look like this- Next, you have to set the time when you want to execute the task. Like Task Scheduler, you can choose any time according to your requirements. The basic command looks like this-
As per this command, the task will run once at 06:30 PM or 18:30 on the same day. It is possible to use various settings like -Daily, -Weekly, -Monthly, etc. On the other hand, you can choose the time in 12 or 24-hour format. If you choose a 12-hour format, you must define the AM/PM. After that, you have to register for the task. For that, enter the following command- Do not forget to change the DemoName, DemoTask, and DemoDescription according to your preference.
Once done, you will be greeted with the following screen-
Delete a scheduled task with PowerShell
To use PowerShell to delete scheduled tasks, follow these steps- To learn more about these steps, keep reading. At first, open an elevated Windows PowerShell window and enter the following command- Don’t forget to replace the DemoTask with the original task name. after that, enter this command to delete the task-
To confirm the removal, you can enter the first command. If it shows an error message, the task is removed. This post offers more ways to delete a Scheduled Task. That’s all! Hope it helps.