Re: Scheduled Defrag Script

Tech-Archive recommends: Speed Up your PC by fixing your registry



We have set defrag to run on clients on even Fridays in the month. We
created two rules with Desktop Authority
(http://www.scriptlogic.com/da) that starts 'defrag' on user desktops
by shutdown event each 2nd and 4th Friday. Shutdown is implemented via
inactivity monitoring which autoshutdowns client computer when it
founds users to be inactive for a predefined period at the end of the
workday.
Josip wrote:
I am wondering how I can get this script:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set objNewJob = objWMIService.Get("Win32_ScheduledJob")

errJobCreated = objNewJob.Create _
("Notepad.exe", "********123000.000000-420", _
True , 1 OR 4 OR 16, , , JobID)
Wscript.Echo errJobCreated

To run defrag every 2 Weeks, on Sunday at 2:00am.

I'm not sure how to change the times, or days, or anything like that, any
help would be appreciated.

Thanks!

.



Relevant Pages

  • Re: OT ? For Computer Experts
    ... The symptoms went away after she did the maintenance I ... > The best thing about scandisk and defrag is that it can get an irate ... something and they become repeat customers, who refer us to their friends. ... I like it when clients call me. ...
    (rec.motorcycles)
  • Re: sluggish responsiveness of vb app using office automation
    ... Recommend you defrag the HDD before doing so .. ... Check Free HDD Space on clients pc. ... Is the disk fragmented and Low on free HDD space? ... > message thread in the newsgroup, ...
    (microsoft.public.data.ado)