Scheduled Task

  • performs routine tasks based on pre-defined triggers:
    • at specific time, daily, wekly, monthly
    • when computer goes idle
    • when system starts
    • when user logs on
    • when system event occurs
  • used to run software updates and other clean-up takss
  • tasks defined in XML format
<Task xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <Triggers>
    <LogonTrigger>
      <Enabled>true</Enabled>
      <UserId>CONTOSO\pchilds</UserId>
    </LogonTrigger>
  </Triggers>
  <Principals>
    <Principal>
      <UserId>CONTOSO\pchilds</UserId>
    </Principal>
  </Principals>
  <Settings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
  </Settings>
  <Actions>
    <Exec>
      <Command>%LOCALAPPDATA%\Microsoft\WindowsApps\updater.exe</Command>
    </Exec>
  </Actions>
</Task>

Run the command schtaskscreate \Beacon XML CREATE and you can selecct XML file

  • can replace \Beacon with any name but it must start with \
beacon> schtaskscreate \Beacon XML CREATE

createTask hostname: taskpath:\Beacon mode:2 force:0
Got user name and security descriptor
Valitdated task
Created task path
Registered task
SUCCESS.

The task can be deleted using schtasksdelete.