ITask::SetWorkingDirectory method (mstask.h)
[[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.] ]
HRESULT SetWorkingDirectory( LPCWSTR pwszWorkingDirectory );
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.
The SetWorkingDirectory method returns one of the following values.
||The operation was successful.|
||The arguments are not valid.|
||Not enough memory is available.|
After setting the working directory of a task, be sure to call IPersistFile::Save to save the modified task object to disk.
For an example of how to set the working directory of a task, see C/C++ Code Example: Setting Working Directory.
|Minimum supported client||Windows 2000 Professional [desktop apps only]|
|Minimum supported server||Windows 2000 Server [desktop apps only]|
|Redistributable||Internet Explorer 4.0 or later on Windows NT 4.0 and Windows 95|