ITask::SetWorkingDirectory
Interfaces

ITask::SetWorkingDirectory


HRESULT SetWorkingDirectory(
    LPCWSTR pwszWorkingDirectory
);

Sets the working directory for the task.

pwszWorkingDirectory
LPCWSTR that contains a directory path. The application starts with this directory as the current working directory. To clear the directory, set pwszWorkingDirectory to L"". If the working directory is set to L"", when the application is run, the current directory will be the directory in which the task scheduler service executable, Mstask.exe, resides.

See also ITask::GetWorkingDirectory

ITaskTrigger

Applications use the methods of the ITaskTrigger interface to access and set triggers for a task. Triggers specify task start times, repetition criteria, and other parameters. The following list of methods is organized in vtable order.

ITaskTrigger methods
SetTrigger
GetTrigger
GetTriggerString

ITaskTrigger::GetTrigger

HRESULT GetTrigger(
    PTASK_TRIGGER pTrigger
);

Retrieves the current task trigger.

pTrigger
Address of a TASK_TRIGGER structure that contains the current task trigger. You must set the cbTriggerSize member of the TASK_TRIGGER structure to be the size of the task trigger structure before passing it to this method.

See also ITaskTrigger::SetTrigger

ITaskTrigger::GetTriggerString

HRESULT GetTriggerString(
    LPWSTR * ppwszTrigger
);

Retrieves the current task trigger in the form of a string. This string appears in the Scheduling Agent user interface in a form similar to "At 2PM every day, starting 5/11/97."

ppwszTrigger
Address of an LPWSTR that contains the description of the current task trigger. The method that invokes GetTriggerString is responsible for freeing this string using the CoTaskMemFree function.

ITaskTrigger::SetTrigger

HRESULT SetTrigger(
    const PTASK_TRIGGER pTrigger
);

Sets the task trigger values.

pTrigger
Address of a TASK_TRIGGER structure containing the values that define the new task trigger.

See also ITaskTrigger::GetTrigger

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.