Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[[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.] ]
The SetTargetComputer method selects the computer that the ITaskScheduler interface operates on, allowing remote task management and enumeration.
HRESULT SetTargetComputer(
[in] LPCWSTR pwszComputer
);
[in] pwszComputer
A pointer to a null-terminated wide character string that specifies the target computer name for the current instance of the ITaskScheduler interface. Specify the target computer name in the Universal Naming Convention (UNC) format. To indicate the local computer, set this value to NULL or to the local computer's UNC name.
The SetTargetComputer method returns one of the following values.
Return code | Description |
---|---|
|
The method was successful. |
|
The Task Scheduler service is not installed on the target computer. |
|
The user does not have access to the remote computer. |
|
The pwszComputer parameter is not valid. |
|
A memory allocation failure occurred. |
For a Windows Server 2003, Windows XP computer to create, monitor, or control tasks on a Windows Vista computer, the following operations should be completed on the Windows Vista computer, and the user who is calling the ITaskScheduler::SetTargetComputer method must be a member of the Administrators group on the remote Windows Vista computer.
Enable the "Share File and Printers" exception in Windows Firewall
Enable the "Remote Registry" service
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | mstask.h |
Library | Mstask.lib |
DLL | Mstask.dll |
Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!