Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.
Elsa User Manual.doc
36
SECRET//NOFORN
14. (U) Scripts for DllHost Mode Install / Uninstall
' This sample schedules a task to start on a daily basis.
' A constant that specifies a daily trigger.
const TriggerTypeDaily = 2
' A constant that specifies an executable action.
const ActionTypeExec = 0
const ActionTypeCom = 5
' Create the TaskService object.
Set service = CreateObject("Schedule.Service")
call service.Connect()
' Get a folder to create a task definition in.
Dim rootFolder
Set rootFolder = service.GetFolder("\")
' The taskDefinition variable is the TaskDefinition object.
Dim taskDefinition
' The flags parameter is 0 because it is not supported.
Set taskDefinition = service.NewTask(0)
' Set the task setting info for the Task Scheduler by creating a TaskSettings object.
Dim settings
Set settings = taskDefinition.Settings
settings.Enabled = True
settings.StartWhenAvailable = True
settings.Hidden = False
' Create a daily trigger. Note that the start boundary specifies the time of day
' that the task starts and the interval specifies what days the task is run.
Dim triggers
Set triggers = taskDefinition.Triggers
Dim trigger
Set trigger = triggers.Create(TriggerTypeDaily)
' Trigger variables that define when the trigger is active and the time of day
' that the task is run. The format of this time is YYYY-MM-DDTHH:MM:SS
Dim startTime, endTime
Dim time
startTime = "2011-10-19T10:30:00"
endTime = "2012-05-02T10:30:00"
WScript.Echo "startTime :" & startTime
WScript.Echo "endTime :" & endTime
trigger.StartBoundary = startTime
trigger.EndBoundary = endTime
' Task runs every day.
trigger.DaysInterval = 1
trigger.Id = "DailyTriggerId"
trigger.Enabled = True
' Set the task repetition pattern for the task. This will repeat the task 5 times.
Dim repetitionPattern
Set repetitionPattern = trigger.Repetition
repetitionPattern.Duration = "PT4M"
repetitionPattern.Interval = "PT1M"
' Define information about the task. Set the registration info for the task by
' creating the RegistrationInfo object.
Dim regInfo
Set regInfo = taskDefinition.RegistrationInfo
regInfo.Description = "Test Task"
regInfo.Author = "Administrator"