反向计划任务脚本

反向计划任务脚本

我已经运行了以下 .cmd 文件,但我不喜欢它,并且想要完全地 撤消更改。我该如何做才能不丢失有关触发器/条件等的原始信息?

@echo off



echo press ctrl-c to cancel, enter to continue
pause >nul
echo.
echo.



echo step 5/8: disable scheduled tasks ...
echo.

schtasks /change /disable /tn "\microsoft\windows\application experience\aitagent" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\application experience\microsoft compatibility appraiser" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\application experience\programdataupdater" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\autochk\proxy" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\customer experience improvement program\consolidator" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\customer experience improvement program\kernelceiptask" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\customer experience improvement program\usbceip" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\diskdiagnostic\microsoft-windows-diskdiagnosticdatacollector" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\maintenance\winsat" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\activatewindowssearch" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\configureinternettimeservice" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\dispatchrecoverytasks" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\ehdrminit" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\installplayready" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\mcupdate" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\mediacenterrecoverytask" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\objectstorerecoverytask" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\ocuractivate" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\ocurdiscovery" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\pbdadiscovery">nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\pbdadiscoveryw1" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\pbdadiscoveryw2" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\pvrrecoverytask" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\pvrscheduletask" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\registersearch" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\reindexsearchroot" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\sqlliterecoverytask" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\media center\updaterecordpath" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\pi\sqm-tasks" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\power efficiency diagnostics\analyzeSystem" >nul 2>nul
schtasks /change /disable /tn "\microsoft\windows\windows error reporting\queuereporting" >nul 2>nul
echo.

timeout 2 >nul



echo done
pause >nul

答案1

我不喜欢它并且想彻底扭转这些变化。

/disable用。。。来代替/enable

F:\test>schtasks /change /?

SCHTASKS /Change [/S system [/U username [/P [password]]]] /TN taskname
     { [/RU runasuser] [/RP runaspassword] [/TR taskrun] [/ST starttime]
       [/RI interval] [ {/ET endtime | /DU duration} [/K] ]
       [/SD startdate] [/ED enddate] [/ENABLE | /DISABLE] [/IT] [/Z] }

Description:
    Changes the program to run, or user account and password used
    by a scheduled task.

Parameter List:

...

/ENABLE              Enables the scheduled task.

/DISABLE             Disables the scheduled task.

进一步阅读

相关内容