DEFRAGMENT COMMAND LINE

G

Guest

The specified command line for defragmenting C: drive is shown (using Command
Prompt) under Windows\System 32\defrag as: C:\Windows\System32\defrag.exe C:
-- but if I attempt going to Start\Run and executing that command line, it
does not in fact bring up the Defragmenter screen nor do any defragmenting.
So, does anyone have a clue as to the correct command line to defragment (for
use with Scheduled Tasks).
 
B

Bert Kinney

Or, at the run command type cmd then defrag c: to defrag the
partition.
For defrag help type defrag /? in the command box.
 
K

Kelly

Hi Don,

Add a Scheduled Task:

Start/Programs/Accessories/System Tools/Scheduled Tasks/Add Scheduled Task.
If Defrag is not listed, use Browse: C:\Windows\System32\defrag.exe...

Defrag All Hard Drives as a Scheduled Task (Line 20)
http://www.dougknox.com/utility/scripts_desc/defrag_all.htm

Add Defrag to the Context Menu (Right Click) - Line 43
http://www.kellys-korner-xp.com/xp_tweaks.htm

There is a command line version that will accept parameters
defrag /f D: (force a defrag of D: drive)

Automating Disk Cleanup Tool in Windows
http://support.microsoft.com/support/kb/articles/q253/5/97.asp

Option:

You can run a batch file or script with the commands:

-go.bat-
start /WAIT %windir%/system32/defrag C: /f
start /WAIT %windir%/system32/defrag D: /f
echo off
echo "defrag done"
pause
--cut here--


--
All the Best,
Kelly (MS-MVP)

Troubleshooting Windows XP
http://www.kellys-korner-xp.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top