我需要知道taskscheduler
是否已成功运行。我发现很难通过wmic
命令获得返回值,因为它们不包含在系统,安全性,应用程序hardwareevents等日志文件中。以下是我的尝试:
wmic ntevent "eventcode=140" get message /value
上面的代码返回消息:“没有实例可用。”
由于我不知道哪种日志文件包含taskschedule
的日志记录,我会通过事件代码选择它们。
wmic ntevent where "logfile='system' and eventcode='140'" get message /vule
无论是logfile='appliaction'
还是logfile='security'
,最后都无法得到我想要的结果。
我需要指出的是,日志记录是在Microsoft-Windows-TaskScheduler / Operational中以图形界面分配的。