对于源批处理文件,命令..。将检索所有任务的列表和我感兴趣的两个值--“TaskName”和“调度任务状态”。/Query /FO LIST /v| findstr /r /C:"TaskName: " >"%USERPROFILE%\Desktop\1-SCHTASKS_LIST_QUERY_NAMES.TXT"
:: Set delimiter/assign v
if (schtasks /query /tn "mytask") {} 当用户在任务计划程序中具有任务名称时但是,当任务名称不存在时,PowerShell会返回错误消息: schtasks : ERROR: The system cannot find the file specified.At line:1 char:5
+ if (scht