tschexec

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagTaskUpdate  uint32 = 0b_00000000_00000000_00000000_00000100
	MethodChange           = "Change"
	DefaultWaitTime        = 1 * time.Second
)
View Source
const (
	TaskXmlHeader         = `<?xml version="1.0" encoding="UTF-16"?>`
	TaskXmlNamespace      = "http://schemas.microsoft.com/windows/2004/02/mit/task"
	TaskXmlVersion        = "1.2"
	TaskXmlDurationFormat = "2006-01-02T15:04:05.9999999Z"
)
View Source
const (
	MethodCreate = "Create"
)
View Source
const (
	MethodDemand = "Demand"
)
View Source
const (
	ModuleName = "TSCH"
)

Variables

View Source
var (
	TaskPathRegex = regexp.MustCompile(`^\\[^ :/\\][^:/]*$`)
	TaskNameRegex = regexp.MustCompile(`^[^ :/\\][^:/\\]*$`)
)

Functions

func ValidateTaskName

func ValidateTaskName(taskName string) error

ValidateTaskName will validate the provided task name according to https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-tsch/fa8809c8-4f0f-4c6d-994a-6c10308757c1

func ValidateTaskPath

func ValidateTaskPath(taskPath string) error

ValidateTaskPath will validate the provided task path according to https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-tsch/fa8809c8-4f0f-4c6d-994a-6c10308757c1

Types

type Tsch

type Tsch struct {
	goexec.Cleaner

	Client *dce.Client

	TaskPath  string
	UserSid   string
	NotHidden bool
	// contains filtered or unexported fields
}

func (*Tsch) Connect

func (m *Tsch) Connect(ctx context.Context) (err error)

func (*Tsch) Init

func (m *Tsch) Init(ctx context.Context) (err error)

type TschChange

type TschChange struct {
	Tsch
	goexec.Executor
	goexec.Cleaner

	IO goexec.ExecutionIO

	WorkingDirectory string
	NoStart          bool
	NoRevert         bool
	WaitTime         time.Duration
}

func (*TschChange) Execute

func (m *TschChange) Execute(ctx context.Context, execIO *goexec.ExecutionIO) (err error)

type TschCreate

type TschCreate struct {
	Tsch
	goexec.Executor
	goexec.Cleaner

	IO goexec.ExecutionIO

	NoDelete    bool
	CallDelete  bool
	StartDelay  time.Duration
	StopDelay   time.Duration
	DeleteDelay time.Duration
	TimeOffset  time.Duration
}

func (*TschCreate) Execute

func (m *TschCreate) Execute(ctx context.Context, execIO *goexec.ExecutionIO) (err error)

type TschDemand

type TschDemand struct {
	Tsch
	goexec.Executor
	goexec.Cleaner

	IO goexec.ExecutionIO

	NoDelete  bool
	NoStart   bool
	SessionId uint32
}

func (*TschDemand) Execute

func (m *TschDemand) Execute(ctx context.Context, execIO *goexec.ExecutionIO) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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