Windows optimize

Defrag and optimize your hard drive with the Windows defrag.exe command line tool

Bill Detwiler shows you how to defragment a hard drive from the Windows 7 command line, and use defrag.exe's hidden "boot optimization" switch.

For nearly as long as there have been traditional, platter and spindle hard drives, IT pros and end users have been defragmenting those drives--to reduce the delay retrieving related data.

And unless you're using a solid-state drive, defragmentation should be part of your normal PC maintenance procedure. In fact, the built-in Windows 7 and Vista Disk Defragmenter utility is configured to run once a week by default.

But what if you're an IT pro, and you prefer working from the command line. Or, you want to create a script that defragments the machines you support. Well, that's where the defrag.exe command line tool can help.

During this week's TR Dojo episode, I show you how to defragment a hard drive using the Windows defrag.exe command line utility, and use the tool's hidden "boot optimization" switch.

Check out the following TechRepublic resources for more defragmentation tips and tools :

For those who prefer text to video, click the View Transcript link below the video player window or check out Mark Kaelin's article, "Exert control and defrag from the command line in Windows 7," on which this video is based.

You can also sign up to receive the latest TR Dojo lessons through one or more of the following methods:

About

Bill Detwiler is Managing Editor of TechRepublic and Tech Pro Research and the host of Cracking Open, CNET and TechRepublic's popular online show. Prior to joining TechRepublic in 2000, Bill was an IT manager, database administrator, and desktop supp...

9 comments
caro31
caro31

Nice tool ! I do not have the necessary privileges for /B Forex en ligne

ThatITGuyTy
ThatITGuyTy

I like this utility. Much more practical to an IT professional than the standard GUI.

IT_ShortBus
IT_ShortBus

Some servers say the boot optimization is turned off in the Registry and others go through the motion without any display and return to the prompt. Any suggestions would be appreciated. Cheers

quedubruit
quedubruit

defrag.exe c: /B tells me that I do not have the necessary privileges. However I'm admin of the system.

stuestrade
stuestrade

Is there a Defrag boot switch for XP Pro?

sparent
sparent

I'll definitely try the /b switch when I get home.

SmartAceW0LF
SmartAceW0LF

As Bill states clearly in this post, "open an elevated command prompt" which when translated means to find your command prompt shortcut in the start menu, right click on it and choose to "Open as Administrator"

rafcord79
rafcord79

tried to but i cannot access the command prompt ;The disk defragmenter cannot start because you have insufficient priveleges to perform this operation. (0x89000024) . Tried to " right click " the command prompt to run administrator but it didnt show.