Defrag



Scott Micale
07-10-2005, 12:30 AM
I have 2 questions about defraging a computer. Is there a way to schedule a
defrag of a computer using group policy and Windows 2003 AD? Is it best
practice to run a defrag in Safe Mode or does it matter if I setup a schedule
and have it run at night in normal made?

Thanks

Torgeir Bakken \(MVP\)
07-10-2005, 12:30 AM
Scott Micale wrote:

> I have 2 questions about defraging a computer. Is there a way
> to schedule a defrag of a computer using group policy and
> Windows 2003 AD?

For the WinXP client computers, you could run Schtasks.exe in a
computer startup script (with a GPO) that runs as part of the boot
up process (before the user logs in). It runs under the system
context and has admin rights.

Use Schtasks.exe to put defrag.exe in a scheduled task running under
an account that have local administrator rights.

Schtasks.exe is a command line tool can create a scheduled task.

To avoid the job being recreated every time the computers reboot,
e.g. check for the .job file in the folder %windir%\Tasks\


> Is it best practice to run a defrag in Safe Mode or does it matter
> if I setup a schedule and have it run at night in normal made?

Running it under normal mode is fine...


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

1badtech
07-10-2005, 12:35 AM
Scott Micale Wrote:
> I have 2 questions about defraging a computer. Is there a way to
> schedule a
> defrag of a computer using group policy and Windows 2003 AD? Is it
> best
> practice to run a defrag in Safe Mode or does it matter if I setup a
> schedule
> and have it run at night in normal made?
>
> Thanks

Yes you don't have to run defrag in safe mode. You can schedule it but
the built-in defrag program is so slow that you really can't do anything
while it's running. Using a third party defrag program gives you the
ability to schedule your defrag or even do it during startup. And it
runs a lot faster than the built-in defrag. It's also smart enough to
determine if your drive needs to be defragged or not.


--
1badtech
------------------------------------------------------------------------
1badtech's Profile: http://forum.osnn.net/member.php?userid=9450
View this thread: http://forum.osnn.net/showthread.php?t=73258


Defrag