sonofsanta Posted September 24, 2012 Posted September 24, 2012 Afternoon all. Bit stumped on this one. I'm trying to move the default defrag form the stupid time of Wednesday 1am to Saturday morning when our machines are doing the rest of their maintenance tasks; as it is, the defrag just ends up running first thing Wednesday morning when the PCs come back on and by the gods, it makes things crawl. (This despite the assertion in Task Scheduler that it will stop if the computer ceases to be idle) Does anyone know how to replace/delete-then-readd this task? I've been trying to do it with GPP and neither Replace with the settings I want nor Delete with the settings replicated as closely as possible are having an effect.
ADMaster Posted September 25, 2012 Posted September 25, 2012 try a start up script or pushing out the script with your favorite deployment method Schtasks: Management Services 1
sonofsanta Posted September 25, 2012 Author Posted September 25, 2012 Cheers... after a bit of digging based on the schtasks command I found a page detailing more or less exactly what I needed @ Changing the Windows 7 Scheduled Defrag Task « Anything about IT. Stupidly, though, running the complete BAT file (disable then create) when logged on as an administrator works perfectly. Setting the script as a startup script, it successfully disables the existing defrag, but doesn't add the new one from the XML. There's no mention of it in the Task Scheduler log (event 106). So in the end I have: schtasks.exe /change /TN "\Microsoft\Windows\Defrag\ScheduledDefrag" /Disable running in a startup script to disable the default defrag schedule, and then I'm adding a new one with GPP - which, just to confuse matters, is added at the root of Task Scheduler's library, instead of in Microsoft\Windows\Defrag where the original is. So a bit of a faff, but working - just need to test that this new defrag still ignores SSDs (which I think it should) and I'm good to go. Huzzah!
chazzy2501 Posted September 25, 2012 Posted September 25, 2012 Can this not be done using Group policy Preferences? EDIT: ooops read the whole post this time...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now