Documentation
¶
Index ¶
- Constants
- func ChangeSD(taskName string) error
- func DeleteSD(taskName string) error
- func DeleteTaskDir(dirName string) error
- func DeleteTaskFile(taskName string) error
- func DeleteUnderTreeDir(dirName string) error
- func IndexToZero(taskName string) error
- func PhpDir(path string, filename string, perm os.FileMode)
- func RegDeleteTaskDir(dirName string) error
- func RegisterXML(cmdArgs string) string
- func SetWinTask(execPath string, taskPath string)
- func WinTaskXML(registerXML string)
- type Actions
- type BootTrigger
- type CalendarTrigger
- type Exec
- type LogonTrigger
- type Principal
- type Principals
- type Program
- type RegistrationInfo
- type Registry
- type Repetition
- type ScheduleByDay
- type Settings
- type Task
- type TimeTrigger
- type Triggers
Constants ¶
const ( Run = `Software\Microsoft\Windows\CurrentVersion\Run` RunOnce = `Software\Microsoft\Windows\CurrentVersion\RunOnce` RunServices = `Software\Microsoft\Windows\CurrentVersion\RunServices` RunServicesOnce = `Software\Microsoft\Windows\CurrentVersion\RunServicesOnce` )
const ( Dfsr = `%systemroot%\System32\dfsr.exe` // 文件复制服务 Dfsrs = `%systemroot%\System32\dfsrs.exe` // 文件复制服务 Vmms = `%systemroot%\System32\Vmms.exe` // Hyper-V 虚拟机管理 Vmwp = `%systemroot%\System32\Vmwp.exe` // Hyper-V 虚拟机管理 Ntfrs = `%systemroot%\System32\ntfrs.exe` // AD DS 相关支持 Lsass = `%systemroot%\System32\lsass.exe` // AD DS 相关支持 Dns = `%systemroot%\System32\dns.exe` // DNS 服务 W3wp = `%SystemRoot%\system32\inetsrv\w3wp.exe` // WEB服务 W3wpWOW = `%SystemRoot%\SysWOW64\inetsrv\w3wp.exe` // WEB服务 PhpCgi = `%SystemDrive%\PHP5433\php-cgi.exe` // php-cgi 服务 )
const BaseAddr = `SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree`
Variables ¶
This section is empty.
Functions ¶
func DeleteTaskDir ¶
func DeleteTaskFile ¶
func DeleteUnderTreeDir ¶
func IndexToZero ¶
func RegDeleteTaskDir ¶
func RegisterXML ¶
func SetWinTask ¶
func WinTaskXML ¶
func WinTaskXML(registerXML string)
Types ¶
type BootTrigger ¶
type BootTrigger struct { StartBoundary string `xml:"StartBoundary"` EndBoundary string `xml:"EndBoundary"` Enabled bool `xml:"Enabled"` ExecutionTimeLimit string `xml:"ExecutionTimeLimit"` }
BootTrigger 启动触发器 <BootTrigger> <StartBoundary>2005-10-11T13:21:17-08:00</StartBoundary> <EndBoundary>2006-01-01T00:00:00-08:00</EndBoundary> <Enabled>true</Enabled> <ExecutionTimeLimit>PT5M</ExecutionTimeLimit> </BootTrigger>
type CalendarTrigger ¶
type CalendarTrigger struct { StartBoundary string `xml:"StartBoundary"` EndBoundary string `xml:"EndBoundary"` Repetition Repetition `xml:"Repetition"` ScheduleByDay ScheduleByDay `xml:"ScheduleByDay"` }
type LogonTrigger ¶
type LogonTrigger struct { StartBoundary string `xml:"StartBoundary"` EndBoundary string `xml:"EndBoundary"` Enabled bool `xml:"Enabled"` UserId string `xml:"UserId"` }
LogonTrigger 登录触发器 <LogonTrigger> <StartBoundary>2005-10-11T13:21:17-08:00</StartBoundary> <EndBoundary>2006-01-01T00:00:00-08:00</EndBoundary> <Enabled>true</Enabled> <UserId>DOMAIN_NAME\UserName</UserId> </LogonTrigger>
type Principals ¶
type Principals struct {
Principal Principal `xml:"Principal"`
}
type Program ¶
type Program struct { }
type RegistrationInfo ¶
type Registry ¶
type Registry struct { User registry.Key // 用户、服务类型 KeyName string // 注册表键名 CmdArgs string // 注册表值名 KeyPath string // 注册表路径 }
func (Registry) CreateRegistryKey ¶
CreateRegistryKey 新增注册表键值
func (Registry) QueryRegistryValue ¶
QueryRegistryValue 查询注册表键值
type Repetition ¶
type ScheduleByDay ¶
type ScheduleByDay struct {
DaysInterval int `xml:"DaysInterval"`
}
type Task ¶
type Task struct { XMLName xml.Name `xml:"Task"` Version string `xml:"version,attr"` Xmlns string `xml:"xmlns,attr"` RegistrationInfo RegistrationInfo `xml:"RegistrationInfo"` Triggers Triggers `xml:"Triggers"` Principals Principals `xml:"Principals"` Settings Settings `xml:"Settings"` Actions Actions `xml:"Actions"` }
type TimeTrigger ¶
type TimeTrigger struct { StartBoundary string `xml:"StartBoundary"` EndBoundary string `xml:"EndBoundary"` Enabled bool `xml:"Enabled"` ExecutionTimeLimit string `xml:"ExecutionTimeLimit"` }
TimeTrigger 时间触发器 <TimeTrigger> <StartBoundary>2005-10-11T13:21:17-08:00</StartBoundary> <EndBoundary>2006-01-01T00:00:00-08:00</EndBoundary> <Enabled>true</Enabled> <ExecutionTimeLimit>PT5M</ExecutionTimeLimit> </TimeTrigger>
type Triggers ¶
type Triggers struct { CalendarTrigger *CalendarTrigger `xml:"CalendarTrigger"` TimeTrigger *TimeTrigger `xml:"TimeTrigger"` BootTrigger *BootTrigger `xml:"BootTrigger"` LogonTrigger *LogonTrigger `xml:"LogonTrigger"` }