大网数据广告活动
Windows Server 管理

The task XML is missing a required element or attribute error when you use the /z switch together with the Schtasks command in Windows Vista

· 52CE 我爱测

Resolve an issue where you receive an error when you use the /z switch together with the Schtasks.exe command in Windows Vista.

This article helps resolve an issue where you receive an error when you use the /z switch together with the Schtasks.exe command in Windows Vista.

Applies to:   Windows Vista
Original KB number:   2004151

Symptoms

When you use the /z switch together with the Schtasks.exe command in Windows Vista, you may receive the following error message:

Error: The task XML is missing a required element or attribute.

The /z switch is used to delete a task after it's completed. For example, you can use the following command to start the Calc.exe process at a specified date and time:

schtasks /create /tn "calculator" /tr c:\Windows\System32\calc.exe /sc once /sd 12/02/2010 /st 03:39:00 /z  

Note: This issue affects only the Schtasks.exe tool. You should be able to use the Scheduled Tasks interface to auto-delete a task after it's completed.

Cause

This issue occurs because of changes in the Task Scheduler service in Windows Vista.

Resolution

To resolve this issue, use the /V1 switch. The /V1 switch creates a task that is compatible with pre-Windows Vista platforms. For example, use the following command to start the Calc.exe process at a specified date and time in a pre-Windows Vista environment:

schtasks /create /tn "calculator" /tr c:\Windows\System32\calc.exe /sc once /sd 12/02/2010 /st 03:39:00 /V1 /Z

More information

For more information about the /V1 switch, visit the following MSDN website:

Schtasks.exe

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
- Supported versions of Windows Client · Source date 02/12/2026
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。