Q: Scheduling Defrag (GUI)

  • Thread starter Thread starter x9012590125
  • Start date Start date
X

x9012590125

Hello all.

I want to run the GUI version of Defrag (DFRG.MSC) as a scheduled task,
but it doesn't work as expected:

Running this .MSC from the "Run..." or DOS box works fine. But if I put
"%WINDIR%\System32\DFRG.MSC" as command-line in a scheduled task, it
just hangs there (presumably awaiting input). Either that, or it starts
and exits right away, depending on the syntax I use.

What I want is for it to run automatically -- and -- perform a disk
analysis of C:

I also tried the following construct, but alas...

"%WINDIR%\System32\CMD.exe" /C START "" /B /I
"%WINDIR%\System32\DFRG.MSC"
(with/out "/I" and "/B")

I know I can use "DEFRAG C: /A", but I want the GUI version. Besides, I
tried that too and it still runs invisibly. Annoying.


Anyone know the magic formula?

Thanks!
M.T.

PS: Please answer within thread -- email is a decoy.
 
How to Automate Disk Defragmenter Using Task Scheduler Tool in Windows XP
http://support.microsoft.com/kb/555098

There are two defrag tools in XP.

dfrg.msc is the pretty one that opens from
Start\All Programs\Accessories\System Tools.

defrag.exe is the command line tool that runs from the command prompt.

defrag.exe is the one that you can schedule.

You cannot schedule dfrg.msc.

There are no switches for dfrg.msc, so it needs a user to click the Analyze
or Defragment buttons.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
Hi Wesley,

Thanks for the reply.

Hmm... I suspected as much. Ok then. Suppose I would schedule "DEFRAG
C: /A". How do I make it interactive so I can interact with the program
and see its output?


Thanks.
M.T.
 
M.T.,

Just run the command, it takes less than 30 seconds for DEFRAG C: /A to run.

Open a command prompt...
Start | Run | Type: cmd | Click OK |
Type: DEFRAG C: /A and hit Enter.

Like this...
---------------
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>DEFRAG C: /A
Windows Disk Defragmenter
Copyright (c) 2001 Microsoft Corp. and Executive Software International,
Inc.

Analysis Report
9.49 GB Total, 1.37 GB (14%) Free, 2% Fragmented (3% file
fragmentation)

You do not need to defragment this volume.

C:\>
---------------

Ooh! I may not need to defrag, but I have to dump a bunch of crap again.
I have to MT out some things, you might say. :-D

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
Back
Top