Scheduling a Defrag

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Windows XP. How can I set my system to automatically do a disk
defragmentation each day? I use the built-in Windows defrag utility rather
than a third party program. Thanks for the help.
 
Chaplain said:
Windows XP. How can I set my system to automatically do a disk
defragmentation each day? I use the built-in Windows defrag utility rather
than a third party program. Thanks for the help.

Considering that you should disable your anti virus' auto scan before
doing a defrag, scheduling is not exactly bright.
 
Alias said:
Considering that you should disable your anti virus' auto scan before
doing a defrag, scheduling is not exactly bright.

I defrag all the time without disabling my virus scan. To schedule a defrag
use the scheduled tasks, in the run put in the following:

C:\WINDOWS\system32\defrag.exe c:

Create a seperate task for each drive and make sure that they are at
different time with enough time for the first to complete as only one
instance can run at a time.
 
You are going to get a bunch of replies telling you you are an idiot for
wanting to do a disk defrag every day. I won't. As a novice, I asked the
same question a few weeks ago. I recommend defrag every month, but that
presumes normal use. Answer is: Use the Task Scheduler under
Start/Settings/Control Panel/Scheduled Task/... There is a wizard that will
let you browse for programs to schedule. You will be given an option to
browse for program files. Search for defrag.exe. It is probably in your
system32 directory.

When you are done, you can right click on this task and select properties.
Under RUN: it should say:

C:\WINDOWS\system32\defrag.exe c:

Except you might be defragmenting a different drive than c:, and your
defrag.exe file might be in a different location. You can search for the
file first to know where to browse for it in the wizard.
 
Mike said:
I defrag all the time without disabling my virus scan.

Try it without it and see if it doesn't do the job faster. And as far as
whether you should or should not, it's your computer, do what you want.
I know it's better to defrag with the AV disabled so I do it that way.
 
Alias said:
Try it without it and see if it doesn't do the job faster. And as far as
whether you should or should not, it's your computer, do what you want. I
know it's better to defrag with the AV disabled so I do it that way.


But... it can be done without disabling your antivirus and it won't harm
anything. As you said, it may just take a little bit longer. Taking a few
extra minutes to run does not make it 'not exactly bright'. My guess is, a
couple of extra minutes during the defrag process isn't going to affect Doug
too much if he's looking at scheduling it anyway.
 
Chaplain said:
Windows XP. How can I set my system to automatically do a disk
defragmentation each day? I use the built-in Windows defrag utility
rather than a third party program. Thanks for the help.


Defragging once a day is *way*overkill. How do you should defrag depends on
you and your computer usage patterns, but for almost everyone, once a month
or so is more than sufficient.
 
Mike said:
But... it can be done without disabling your antivirus and it won't harm
anything. As you said, it may just take a little bit longer. Taking a few
extra minutes to run does not make it 'not exactly bright'. My guess is, a
couple of extra minutes during the defrag process isn't going to affect Doug
too much if he's looking at scheduling it anyway.

That's only one of the reasons. If you want your AV checking files while
you're defragging, be my guest. I don't.
 
Alias said:
That's only one of the reasons. If you want your AV checking files while
you're defragging, be my guest. I don't.

I just don't see why you'd have to call someone stupid for doing it. Oh, I
mean 'not exactly bright'.

The other thing is, Most VirusScanners are not going to actively scan every
file that's being moved by the defrag process. I'm using McAfee Enterprise
and it it's process stays at 00% CPU usage during a defrag. It's not like
you're reading and writing files, XP is using a system process to re-arrange
the files on your hard drive. If the defrag process actually read files
into memory then turned around and did a write to move the files, it would
take an extremely long time to defrag any drive.

If you're unable to to give me exact reasons and supporting links to show me
that it is a 'bad' thing to do, then I suggest that you stop discouraging
people from doing it. Disabling you virus scanner could potentially be much
more harmful.
 
Mike said:
I just don't see why you'd have to call someone stupid for doing it. Oh, I
mean 'not exactly bright'.

It isn't.
The other thing is, Most VirusScanners are not going to actively scan every
file that's being moved by the defrag process. I'm using McAfee Enterprise
and it it's process stays at 00% CPU usage during a defrag. It's not like
you're reading and writing files, XP is using a system process to re-arrange
the files on your hard drive. If the defrag process actually read files
into memory then turned around and did a write to move the files, it would
take an extremely long time to defrag any drive.

If you're unable to to give me exact reasons and supporting links to show me
that it is a 'bad' thing to do, then I suggest that you stop discouraging
people from doing it. Disabling you virus scanner could potentially be much
more harmful.

If the AV wasn't doing anything, why does the defrag run quicker with it
disabled?

Do you also install programs or updates with your auto scan enabled?

Disabling your AV auto scan when you are only defragging or installing a
program you trust cannot be harmful in any way.
 
Chaplain said:
Windows XP. How can I set my system to automatically do a disk
defragmentation each day? I use the built-in Windows defrag utility rather
than a third party program. Thanks for the help.

It's my recollection that the Task Scheduler will not wake from a standby
state. So, if you schedule your defrag for 3 a.m. and the system is in standby
at that time, nothing will happen. In Googling for a definitive statement on
this point (which I couldn't find in the time I wanted to spend), I came across
this utility which claims to be able to programmatically wake from standby.
http://www.dennisbabkin.com/php/download.php?what=WOSB
Use at your own risk: I have no idea if it works, if it's virus-free, or
anything else about it.
 
In said:
It's my recollection that the Task Scheduler will not wake
from a standby state. So, if you schedule your defrag for 3
a.m. and the system is in standby at that time, nothing will
happen. In Googling for a definitive statement on this
point (which I couldn't find in the time I wanted to spend),
I came across this utility which claims to be able to
programmatically wake from standby.
http://www.dennisbabkin.com/php/download.php?what=WOSB
Use at your own risk: I have no idea if it works, if it's
virus-free, or anything else about it.

If you want your computer to come out of standby to run a
scheduled task do the following:
Go to Control Panel, double click Scheduled Tasks
Right click the task you want to run and select Properties from
the menu.
Click on the Settings tab.
At the bottom of that page, put a check mark in the box next to
"Wake the computer to run this task".
Click OK.

Nepatsfan
 
Chaplain Doug,
I have a simple program that you can download and setup XP to do that for you.
You have to be the Admin and you'll have to set a password.
It can be found here:
http://www.marvswindowstips.com/Downloads/AutoDefrag.exe
Save it to your desktop.
Unzip it to your Desktop, then print the instructions.
Just follow the instructions, it's not very hard.
It is running on all of my computers.
 
Chaplain Doug said:
Windows XP. How can I set my system to automatically do a disk
defragmentation each day? I use the built-in Windows defrag utility
rather
than a third party program. Thanks for the help.
Why so often? Once a month might be overkill.
Jim
 
Technically, there is no need to disable A/V prior to running a defrag.
Real time protection that A/V software does runs as a file system filter -
which means it does exactly that - filtering disk read/writes. When the
file system actually performs the file "move" when defragmenting, it is
responsible for doing all of the low level I/O synchronization necessary -
including working with any file system filters that may be running (A/V,
GoBack, other real time replication software).

Some A/V can be configured to filter just reads, just writes, or both.
Depending on how effeciently written the file system filter is, the filter
may or may not be capable of quickly processing the disk read/writes
generated by defragmenting. If the filter is in-effeciently written - it
can drastically slow things down. If the filter is effeciently written, you
won't notice much of anything.

- Greg/Raxco Software
Microsoft MVP - Windows File System

Disclaimer: I work for Raxco Software, the maker of PerfectDisk - a
commercial defrag utility, as a systems engineer in the support department.

Want to email me? Delete ntloader.
 
Thank you Greg. I was hoping someone else would jump in to let Alias know
that you don't have to turn off your A/V to run a defrag. My biggest
concern was the fact that he/she was saying it was 'not bright' to run a
defrag with your A/V turned on.

IMO turning your A/V off to run a defrag leaves your system vulnerable
during that time and isn't worth the risk with the number of viruses out
there today.
 
Mike said:
Thank you Greg. I was hoping someone else would jump in to let Alias know
that you don't have to turn off your A/V to run a defrag. My biggest
concern was the fact that he/she was saying it was 'not bright' to run a
defrag with your A/V turned on.

It isn't. Greg's wrong.
IMO turning your A/V off to run a defrag leaves your system vulnerable
during that time and isn't worth the risk with the number of viruses out
there today.

Not true. If you have a proper firewall, viruses cannot just pop in and
say hello. I have turned off my AV for updates, installing all programs,
defragging and running anti malware programs. I have never had a virus
since I went online in 97.
 
Not everyone has a properly setup firewall... so, STOP giving out
potentially harmful advice! Running defrag, updates and installing programs
with A/V turned on has never caused me and a million other poeple out there
ANY problems.

For users that really know what they are doing, sure, you can do what you
say, but for the majority of users and readers of these news groups, doing
what you are suggesting could be very harmful.
 
Mike said:
Not everyone has a properly setup firewall...

Which is dangerous. The only time disabling your AV is dangerous is when
you are doing something that could possibly incur a virus, etc. If all
you're doing is defragging, there is no need for the AV auto scan to be
on unless you like your AV scanning your defrag process, something I can
do without.
so, STOP giving out
potentially harmful advice!

I'm not. You are uninformed and telling people they don't need a
properly configured firewall *is* harmful advice.
Running defrag, updates and installing programs
with A/V turned on has never caused me and a million other poeple out there
ANY problems.

False but, hey, it's your machine, do what you want. I will not,
however, condone your uninformed advice.
For users that really know what they are doing, sure, you can do what you
say, but for the majority of users and readers of these news groups, doing
what you are suggesting could be very harmful.

Turn off your firewall for a day or two and leave your AV on and get
back to me if you can.
 
Alias said:
I'm not. You are uninformed and telling people they don't need a properly
configured firewall *is* harmful advice.

Nowhere did I say that people shouldn't have a properly configured firewall.
Stop reading into my posts what's not there. A properly configured firewall
is just as important as a properly configured virus scanner.
Turn off your firewall for a day or two and leave your AV on and get back
to me if you can.

Nowhere did I say it was safe to run without a firewall. Stop reading into
my posts what's not there.
I will not, however, condone your uninformed advice.

Where did I give out uninformed advice? If you think it's uninformed to
tell people that it's ok to install programs, run a defrag or install
windows updates without disabling their antivirus scanner then you best
educate yourself a little more.

Tell me exactly what harm could your A/V scanner cause if it's running when
installing a program, running a defrag or installing updates? Think hard
about this one, because taking an extra few seconds or even minutes does not
make it harmful and so far the only thing you said it does is take longer.
 
Back
Top