Skip to content

Latest commit

 

History

History
130 lines (101 loc) · 3.72 KB

nf-mstask-itask-setworkingdirectory.md

File metadata and controls

130 lines (101 loc) · 3.72 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:mstask.ITask.SetWorkingDirectory
ITask::SetWorkingDirectory (mstask.h)
This method sets the working directory for the task.
ITask interface [Task Scheduler]
SetWorkingDirectory method
ITask.SetWorkingDirectory
ITask::SetWorkingDirectory
SetWorkingDirectory
SetWorkingDirectory method [Task Scheduler]
SetWorkingDirectory method [Task Scheduler]
ITask interface
_msb_itask_setworkingdirectory
mstask/ITask::SetWorkingDirectory
taskschd.itask_setworkingdirectory
taskschd\itask_setworkingdirectory.htm
taskschd
df12d899-c254-4bbf-a49f-d89a2fcb0e28
12/05/2018
ITask interface [Task Scheduler],SetWorkingDirectory method, ITask.SetWorkingDirectory, ITask::SetWorkingDirectory, SetWorkingDirectory, SetWorkingDirectory method [Task Scheduler], SetWorkingDirectory method [Task Scheduler],ITask interface, _msb_itask_setworkingdirectory, mstask/ITask::SetWorkingDirectory, taskschd.itask_setworkingdirectory
mstask.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Mstask.lib
Mstask.dll
Windows
Internet Explorer 4.0 or later on Windows NT 4.0 and Windows 95
19H1
ITask::SetWorkingDirectory
mstask/ITask::SetWorkingDirectory
c++
APIRef
kbSyntax
COM
Mstask.dll
ITask.SetWorkingDirectory

ITask::SetWorkingDirectory

-description

[[This API may be altered or unavailable in subsequent versions of the operating system or product. Please use the Task Scheduler 2.0 Interfaces instead.] ]

This method sets the working directory for the task.

-parameters

-param pwszWorkingDirectory [in]

A null-terminated string that contains a directory path to the working directory for the task.

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.

-returns

The SetWorkingDirectory method returns one of the following values.

Return code Description
S_OK
The operation was successful.
E_INVALIDARG
The arguments are not valid.
E_OUTOFMEMORY
Not enough memory is available.

-remarks

After setting the working directory of a task, be sure to call IPersistFile::Save to save the modified task object to disk.

Examples

For an example of how to set the working directory of a task, see C/C++ Code Example: Setting Working Directory.

-see-also

GetWorkingDirectory

ITask