schtasks

package
v1.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const TaskName = taskName

TaskName is the Windows scheduled task name. Exported so other packages (e.g. schedinfo) can query the task without re-deriving the constant.

Variables

This section is empty.

Functions

func Install

func Install(exec executor.Executor, log *progress.Logger) error

Install configures Windows Task Scheduler for periodic scanning. If already installed, upgrades by removing and re-creating the task.

func IsTaskRegistered added in v1.11.4

func IsTaskRegistered() bool

IsTaskRegistered reports whether the Windows scheduled task created by `dev-machine-guard install` is currently registered. Used by the telemetry package's invocation detector to distinguish a manual CLI run from a scheduler-triggered one. Any error or non-zero schtasks exit is treated as "not registered" so a transient Schedule-service hiccup degrades to "one_time" rather than erroring the run.

func RunNow added in v1.11.7

func RunNow(exec executor.Executor, log *progress.Logger) error

RunNow asks Task Scheduler to fire the registered task immediately, using its configured principal (/ru INTERACTIVE for admin installs). Used by the install flow under LocalSystem to surface first-run telemetry under the logged-in user rather than scanning SYSTEM's empty profile inline.

schtasks /run returns 0 once the scheduler has accepted the request; it does not wait for the task to complete and does not report whether an interactive session exists. If no user is logged in, the trigger silently no-ops and the task fires on its next hourly tick.

func Uninstall

func Uninstall(exec executor.Executor, log *progress.Logger) error

Uninstall removes the scheduled task.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL