try a start up script or pushing out the script with your favorite deployment method
Schtasks: Management Services
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.
sonofsanta (25th September 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:
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.Code:schtasks.exe /change /TN "\Microsoft\Windows\Defrag\ScheduledDefrag" /Disable
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!
Can this not be done using Group policy Preferences?
EDIT: ooops read the whole post this time...
There are currently 1 users browsing this thread. (0 members and 1 guests)