Sign in to follow this  
Followers 0
Valuater

Turn off Vista auto defrag

7 posts in this topic

I don't have vista, however I was hoping someone could show me the registry key and value for setting this... "Run Automatically"

Posted Image

do I need Admin authority too?

thanks,

Valuater

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites



I tried monitor DfrgNtfs.exe with ProcMon while I changed the setting and closed the dialog, it opened a bunch of registry values, but it didn't change the value of anyone important, so I suspect that maybe it saves it to a file or something.

I can upload the entire log if you want? It's pretty massive but it really should be somewhere in there.


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Jus' do it like the Pros... :)

#RequireAdmin
global $objService

$objService = objcreate("Schedule.Service")

if isobj($objService) then
    $objService.Connect()
    $rootFolder = $objService.GetFolder("\Microsoft\Windows\Defrag")
    GetTasks($rootFolder)
else
    msgbox("", "Vista Scheduler Automation", "NO SCHEDULER SERVICE OBJECT" & @crlf & @crlf & "YOU'RE PROBABLY NOT ON VISTA / W2K8...")
    exit
endif


func GetTasks($folder)
    $colTasks = $folder.GetTasks(0)
    for $task in $colTasks
        if $task.name = "ScheduledDefrag" Then
            $Disclaimer = MsgBox(36, "Vista Scheduler Automation", "Do you want to delete the defrag-task """ & $task.name & """?")
            if $Disclaimer = 6 then
                $folder.DeleteTask($task.name, 0)
            endif
        endIf
    next
endfunc

...and don't bother 'bout the registry...if the task is gone, no automatic defragmentation will happen ("automatic" being an euphemism in this case, 'coz something that is scheduler-controlled is not automatic in my opinion).

Edited by cherdeg

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Don't scratch your head. :) Just look at my other thread of today and you will see I'm far away to reach your MVP level...but I am probably one of the first 100 ppl in DE to be certified as MCITP: Enterprise Administrator on Server 2008 (after being MCSA Security 2003, MCSA Messaging 2003, Linux Administrator by LPI I+II and VMware Certified Professional (VCP) yet for a while). At least it must be worth something. And if I see the words "Modify schedule" on the button of a Microsoft-dialog, I know where to look...

BTW-1: If somebody wants to write a UDF for task-scheduler...these pages will come handy:

http://www.microsoft.com/technet/scriptcen...sta/tasks1.mspx

http://msdn.microsoft.com/en-us/library/aa383614.aspx

http://msdn.microsoft.com/en-us/library/aa382560(VS.85).aspx

BTW-2: If you start the program disk defragmenter, the task is re-created. Someone should check if this also happens when restarting.

Edited by cherdeg

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

And us MVPs are supposed to be the pros...

:)

Didn't see this before, man you guys are early risers!!... :)

Thanks Volly, monoceres and cherdeg

I will give that object approach a try!!

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0