如何创建批处理脚本以每5分钟查找一次特定的事件ID (事件id : 26),如果发现事件id为26,则在windows server 2003 r2中执行某些命令(终止特定的windows服务并重新启动它)?
发布于 2015-06-10 03:56:30
来自schtasks /create /?
==> Creates a scheduled task "EventLog" to run wevtvwr.msc starting
whenever event 101 is published in the System channel
SCHTASKS /Create /TN EventLog /TR wevtvwr.msc /SC ONEVENT
/EC System /MO *[System/EventID=101]
和
==> Creates a scheduled task "logtracker" on remote machine "ABC"
to run notepad.exe every five minutes starting from the
specified start time with no end time. The /RP password will be
prompted for.
SCHTASKS /Create /S ABC /U domain\user /P password /SC MINUTE
/MO 5 /TN logtracker
/TR c:\windows\system32\notepad.exe /ST 18:30
/RU runasuser /RP
https://stackoverflow.com/questions/30740551
复制相似问题