0% found this document useful (0 votes)
189 views3 pages

11.6.1.5 Lab Schedule A Task Using The GUI and The Command Line

This document provides instructions for scheduling tasks using both the Windows Task Scheduler GUI and command line. It describes how to: 1. Use the Task Scheduler GUI to schedule a weekly Disk Cleanup task to run every Friday at 6 PM, then edit the task to add an argument and run it immediately. 2. Use command line commands to schedule a daily Notepad task to run at 11 AM, run and change the scheduled time of the task, and delete the task. 3. Suggests that using the command line can speed up creating the same task on multiple computers, and that backing up files weekly would be another useful scheduled task.

Uploaded by

Ridwan Fahmi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
189 views3 pages

11.6.1.5 Lab Schedule A Task Using The GUI and The Command Line

This document provides instructions for scheduling tasks using both the Windows Task Scheduler GUI and command line. It describes how to: 1. Use the Task Scheduler GUI to schedule a weekly Disk Cleanup task to run every Friday at 6 PM, then edit the task to add an argument and run it immediately. 2. Use command line commands to schedule a daily Notepad task to run at 11 AM, run and change the scheduled time of the task, and delete the task. 3. Suggests that using the command line can speed up creating the same task on multiple computers, and that backing up files weekly would be another useful scheduled task.

Uploaded by

Ridwan Fahmi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Lab – Schedule a Task Using the GUI and the Command Line

Introduction
In this lab, you will schedule a task using the Windows Task Scheduler utility. You will then make changes to your task
and test your task by running it.

Recommended Equipment
 A computer running Windows

Instructions

Part 1: Schedule a Task Using the GUI

Step 1: Run the Create Basic Task wizard.


a. Click Start and search for Task Scheduler.
a. Click Create Basic Task in the Actions pane.
b. In the Create a Basic Task screen of the Create Basic Task Wizard window, enter Disk Cleanup in the
Name: field, and then click Next.
c. In the Task Trigger screen, select the Weekly radio button. Click Next.
d. On the Weekly screen, use the scroll buttons in the Start: field to set the time to 6:00:00 PM. Set the
Recur every _ weeks on: field to 1. Check the Friday checkbox. Click Next.
e. On the Action screen, make sure Start a program is selected. Click Next.
f. On the Start a program screen, click Browse.
g. Type cle in the File name: field, select cleanmgr.exe, and click Open.
h. The Start a Program screen re-opens with C:\Windows\System32\cleanmgr.exe added to the
Program/script: field. Click Next.
i. Review the Summary screen and click Finish.

Step 2: Review and make changes to your scheduled task.


a. In the left pane of the Task Scheduler window, select Task Schedule Library. Note:
You may need to click Refresh to see the new Disk Cleanup task you created.
b. Select the task Disk Cleanup and then click Properties in the right pane.
c. The Disk Cleanup Properties (Local Computer) window opens. In the Configure for: drop-down menu,
select Windows 10.
d. Click the Actions tab. Select the Start a program row, and then click Edit.
e. In the Edit Action window, type /d c: in the Add Arguments (optional): field. Click OK.
The /d c: argument tells the cleanmgr.exe program to clean the C: drive.
f. To close the Disk Cleanup Properties (Local Computer) window, click OK.

 2015 - 2023 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 3
Lab – Schedule a Task Using the GUI and the Command Line

Step 3: Run the scheduled task now.


a. Select the Disk Cleanup task and click Run in the right pane of the Task Scheduler window.
b. Click the Disk Cleanup icon that appears on the Task Bar.
c. The Disk Cleanup window is brought to the foreground. This window displays the status of the Disk
Cleanup process.
Note: It may take a few minutes for Disk Cleanup to complete.
d. When the Disk Cleanup process completes, the Disk Cleanup for Local Disk (C:) window opens. Click
Cancel.
Note: Clicking OK will delete the files selected in the Files to delete: box. Check with your instructor before
clicking OK. Clicking OK will open the Disk Cleanup verification window asking if you are sure you want to
permanently delete these files. It is not necessary to delete these files to complete this lab. If you are sure you want
to delete these files permanently, click Delete Files.

Step 4: Delete a scheduled task.


a. Navigate back to the Task Scheduler to delete the Disk Cleanup task you created, select the Disk Cleanup task
and click Delete in the right pane of the Task Scheduler window. If prompted, click Yes to delete the Disk
Cleanup task.
b. Verify the Disk Cleanup task you created is removed from the Task Scheduler window. Close Task
Scheduler.

Part 2: Schedule a Task using the CLI

Step 1: Schedule a task.


a. Open the command prompt. In the Windows search, type cmd to open the command prompt. The
syntax for creating a task in the CLI is as follows:
SCHTASKS /CREATE /SC DAILY /TN "FOLDERPATH\TASKNAME" /TR
"C:\SOURCE\FOLDER\APP-OR-SCRIPT" /ST HH:MM
b. Type the following command to create a daily task to run an app at 11:00 a.m.
SCHTASKS /CREATE /SC DAILY /TN "MyTasks\Notepad task" /TR "C:\Windows\
System32\notepad.exe" /ST 11:00
Note: The folder path before the task name, under the /TN option, is not a requirement, but will help keep tasks
separate. If no path is specified, the task will be created inside the Task Scheduler Library folder.

When might it be useful to use the CLI to schedule a task rather than the GUI?
when an administrator needs to speed up the process creating the same task on multiple computers.

Step 2: Run the scheduled task.


To start a scheduled task immediately use the schtasks /run /tn <TaskName> command. The run operation ignores
the schedule.
SCHTASKS /RUN /TN “MyTasks\Notepad task”

Step 3: Change a scheduled task.


a. Open the command prompt. In the Windows search type cmd to open the command prompt.

 2015 - 2023 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 3
Lab – Schedule a Task Using the GUI and the Command Line

b. Type the following command to change the daily task to run an app at 9:00 a.m. instead of 11:00 a.m. Enter the
password for the indicated username when prompted.
SCHTASKS /CHANGE /TN "MyTasks\Notepad task" /ST 09:00

Step 4: Delete a scheduled task.


a. Open the command prompt. In the Windows search type cmd to open the command prompt.
b. Type the following command to delete the daily task. Enter y to confirm that you wanted to delete the
scheduled task.
SCHTASKS /DELETE /TN "MyTasks\Notepad task"

Reflection Question
What other weekly tasks would be useful to run in Task Scheduler?
good weekly task would be to backup personal files to another disk.

 2015 - 2023 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 3

You might also like