1

I have run the following .cmd file and I do not like it and want to completely reverse the changes. How would I do this without losing the original information about triggers/conditions 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
1
  • Export your scheduled tasks to XML files before enabling all of them if you feel the /enable switch as per David's answer below will not retain those other settings in each scheduled task such of the triggers, conditions, etc. askvg.com/… Dec 13, 2015 at 1:30

1 Answer 1

1

I do not like it and want to completely reverse the changes.

Replace /disable with /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.

Further Reading

4
  • Other settings won't change? Dec 13, 2015 at 8:28
  • @minusatwelfth Not as far as I know.
    – DavidPostill
    Dec 13, 2015 at 9:26
  • Err, so they won't or will change? Dec 13, 2015 at 13:16
  • @minusatwelfth Won't change. Why don't you try just enabling just one of them, then look at settings using the GUI?
    – DavidPostill
    Dec 13, 2015 at 13:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .