Reverse script de tarefas agendadas

1

Eu executei o seguinte arquivo .cmd e não gosto dele e quero completamente inverter as alterações. Como eu faria isso sem perder as informações originais sobre gatilhos / condições etc.?

@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
    
por minusatwelfth 12.12.2015 / 08:28

1 resposta

1

Eu não gosto disso e quero reverter completamente as mudanças.

Substitua /disable por /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.

Leitura Adicional

por 12.12.2015 / 10:55