Scheduling W2K Defrag Using Bat File

Gary and John-

I found this ages ago. I don't know that I ever got it to work, but
here it is...

*******************************************
Defragmentation on W2K

From a command prompt:

runas /user:csmachine\administrator "mmc dfrg.msc"

The user is prompted for the administrator password. This command may be
useful
for an administrator who wants to run a defragmentation on a user's
computer
without forcing the user to log off.

- OR -

You can also use the following procedure to schedule the Dfrg.msc
console to run
on a user's desktop in the context of the administrators account. This
allows a
normal user to manually defragment drives without performing any other
unauthorized administrative tasks.

1. From another networked computer in the domain, log on as a user who
has
administrator privileges.

2. At a command prompt, type the following command

at \\<machine_name> 5:00pm /interactive /every:f
c:\winnt\system32\dfrg.msc

where <machine_name> is the name of a normal user's computer.

You can adjust the command to fit your needs. The above example starts
the
defragmenter console on the user's computer with administrative rights
every
Friday at 5:00 P.M. so the user can manually select and start a
defragmentation
process.

Or, an administrator could build a batch file with separate lines for
each
workstation without using the /every switch, and then run the batch file
manually whenever users should run a defragment operation.

*******************************************

Good Luck! I hope this helps!

Steven Russell
C & S Machine Products, Inc.

------------------------------------------------------------------------
---------

Message: 1
Date: Thu, 15 Aug 2002 19:52:20 -0000
From: "pennstatetool" <johne@...>
Subject: Re: Scheduling W2K Defrag Using Bat File

Gary,
I went through this a few months back. According to what I read, the
stripped-down version of Diskeeper (WIN2K Defrag) requires direct
user intervention and could not be scheduled to run automatically.
If you do come up with a way to make it happen, I'd like to hear
about it. Good luck.

John Elder
Penn State Tool & Die

--- In vantage@y..., "Gary Polvinale" <garyp@d...> wrote:
> You're supposed to be able to schedule Defrag utility that comes
with W2K
> (basically Diskeeper) using a batch file and the W2K task
scheduler. I
> couldn't find anything in windows help or on the microsoft support
site
> about this. I want to be able to run it overnight on all the
workstations.
> Does anyone know how this is done?
>
> Gary
You're supposed to be able to schedule Defrag utility that comes with W2K
(basically Diskeeper) using a batch file and the W2K task scheduler. I
couldn't find anything in windows help or on the microsoft support site
about this. I want to be able to run it overnight on all the workstations.
Does anyone know how this is done?

Gary



[Non-text portions of this message have been removed]
Gary,
I went through this a few months back. According to what I read, the
stripped-down version of Diskeeper (WIN2K Defrag) requires direct
user intervention and could not be scheduled to run automatically.
If you do come up with a way to make it happen, I'd like to hear
about it. Good luck.

John Elder
Penn State Tool & Die

--- In vantage@y..., "Gary Polvinale" <garyp@d...> wrote:
> You're supposed to be able to schedule Defrag utility that comes
with W2K
> (basically Diskeeper) using a batch file and the W2K task
scheduler. I
> couldn't find anything in windows help or on the microsoft support
site
> about this. I want to be able to run it overnight on all the
workstations.
> Does anyone know how this is done?
>
> Gary