Printer Friendly Version      Send     
Click to Rate and Give Feedback
Related Articles

Web logs and traffic analysis can give you a good idea of the kind of traffic you can expect over time. But how can you determine what your infrastructure can handle? The free Web Capacity Analysis Tool can help you to see how your systems will perform under stress.

Greg Steen

TechNet Magazine April 2008

...

Read more!

This free tool can simplify the migration of key applications from Windows XP to Windows Vista.

Lance Whitney

TechNet Magazine January 2008

...

Read more!

Explore the SharePoint Capacity Planning Tool and see how you can design a topology for deploying SharePoint and then revise that topology after running load and usage simulations.

Peter Skjøtt Larsen and Satish Mathew

TechNet Magazine May 2008

...

Read more!

Find out how you can start using Windows PowerShell cmdlets to manage SMS 2003 clients from the command line.

Don Brown

TechNet Magazine November 2007

...

Read more!

To help ISVs and customers gauge application compatibility, Microsoft created the "Works with Windows Server 2008" program. Here's a look at the free supporting test tools made available through the program that can help you ensure that applications will deliver a predictable experience.

Venkat Krishnamachari

TechNet Magazine March 2008

...

Read more!

Also by this Author

Lance Whitney

TechNet Magazine January 2007

...

Read more!

Ready to upgrade the systems in your organization to Windows Vista? Find out how the Windows Vista Upgrade Advisor can help you determine whether your systems are ready for Windows Vista and which versions they can support.

Lance Whitney

TechNet Magazine June 2008

...

Read more!

Wouldn’t it be great if you could see everything you need to know about a PC—its name, IP address, gateway, free disk space, and so on—in a single place. You can, with this free tool from Sysinternals.

Lance Whitney

TechNet Magazine August 2007

...

Read more!

Whether you develop Web content or simply support a webmaster, here’s a free Microsoft utility that will make your job easier. See how the Internet Explorer Developer Toolbar can help you explore and troubleshoot Web pages.

Lance Whitney

TechNet Magazine November 2008

...

Read more!

The vast number of apps that run automatically at system start up can be a source of endless headaches. But with Autoruns, you can investigate every app that runs automatically, letting you troubleshoot conflicts, track down malware, and free up system resources.

Lance Whitney

TechNet Magazine April 2007

...

Read more!

Popular Articles

Microsoft Application Virtualization (App-V) allows you to deliver virtualized desktops to client systems throughout your organization. This simplifies system management and liberates employees from their desktops. Take a close look at how App-V works and discover how you can deploy it in your organization.

Anthony Kinney

TechNet Magazine October 2008

...

Read more!

PsTools provides a gaggle of useful utilities for system administration. Explore all the tools this free suite has to offer and learn how you can use them to do everything from changing a user account password and viewing a user's SID to gathering system information and managing processes.

Wes Miller

TechNet Magazine March 2007

...

Read more!

Michael Murgolo is back with an update to his Elevation PowerToys. You'll find enhanced Run as Administrator functionality that works with third-party scripting tools, a way to replace a handy Windows XP feature removed from Windows Vista, and many more useful tools.

Michael Murgolo

TechNet Magazine June 2008

...

Read more!

The new version of SQL Server offers a host of new features and enhancements that promise to improve performance, increase security, and make life better for database administrators. Here’s an overview of the key changes and what you can expect from SQL Server 2008.

Randy Dyess

TechNet Magazine April 2008

...

Read more!

Wikis offer a new, more flexible way to collaborate, promoting an unstructured approach to thinking and exchanging ideas. And MOSS 2007 makes it incredibly easy to implement wikis in your organization. Here’s what you need to know to start building and using wikis in the workplace.

Mauro Cardarelli

TechNet Magazine January 2007

...

Read more!

Our Blog
In this month’s TechNet Magazine, you’ll find the second of a series of Field Notes columns written by Romi Mahajan, Chief Marketing Officer of Ascentium Corporation. As an early innovator in the field of electronic ...

Read more!

Have various workers in your company been showing up with questions about Macs? The odds of having a homogeneous network today are very unlikely. Macs are becoming increasingly popular and chances are if you don't already have some on your network, soon you will. 

Don't consider this a burden. This actually creates a fantastic opportunity for you as an IT professional. Instead of being an administrator who says "I don't ...

Read more!

Up is up and down is down, right? Maybe so, but sometimes the two are not as separate as you’d think. That’s definitely the case when it comes to server uptime: if you want to report on server uptime, you need to be able to calculate server downtime. The Microsoft Scripting Guys present  a Windows PowerShell ...

Read more!

The December 2008 issue of TechNet Magazine is now available online. And it's filled with information about interop.

Find out how to integrate Linux clients with ...

Read more!

Did you just go “whoa!” when you saw that title? Bet you never thought you’d see that here! But the times, as they say, are a-changing and we have too. Many organizations today use multiple operating systems. We all have the same goal of providing high-quality, cost-effective IT services to the organization, and one way we can do that is by sharing core software infrastructure like Active Directory. ...

Read more!

Utility Spotlight PageDefrag
Lance Whitney

Download the code for this article: PageDefrag (70KB)

Your average Windows® defragmenter can optimize most files on your hard drive, but some items are beyond the powers of most defragging tools. Files that are open and locked for exclusive use, such as the Windows page file and Registry hives, aren't normally processed by the built-in Windows defragmenter or by third-party utilities. The standard Windows APIs don't support defragmentation of these files while they're in use. Luckily, the PageDefrag utility, created by Mark Russinovich for Sysinternals, saves the day by defragging items untouched by other tools.
PageDefrag can defragment the Windows page file, Registry hives, event logs, and the hibernation file (the area on disk where memory is saved when a notebook jumps into hibernation mode). The program optimizes these files during the PC's bootup sequence before they're in use.
To run PageDefrag, just double-click the pagedfrg.exe file. The program displays the name of each file it can process for defragmentation (see Figure 1). The page file is pagefile.sys. The Registry hives appear as individual files for each hive—DEFAULT, SAM, SECURITY, SOFTWARE, and SYSTEM. The event logs also display as their individual files; for example, AppEvent.evt is the Application log, SecEvent.evt is the Security log, and SysEvent.evt is the System log. Finally, the hibernation file is Hiberfil.sys.
Figure 1 PageDefrag displays the names of each file it can process (Click the image for a larger view)
Next to each file name is a Clusters column, which shows you how many clusters on the disk are allocated to the file, and a Fragments column, which indicates how many fragmented, or noncontiguous, pieces of the file are scattered around the disk. Based on this data, you can determine whether or not the files need defragmentation.
You have two options: you can defrag the files at the next bootup or at every bootup. Unless the files are heavily used or the PC is a server or other box that's rarely rebooted, you should be fine just defragmenting them at the next bootup. You can also enable a countdown so you have time to cancel the defragmentation as soon as the PC starts up.
The next time you reboot the computer, the normal chkdsk command runs, and then PageDefrag goes into action. Files already organized into contiguous clusters are bypassed. Those broken into fragments are optimized one by one. The program displays the name of each item being defragmented, tells you if the defrag is successful, and lists the number of clusters allocated to the file, both before and after defragmentation.
PageDefrag may not be able to optimize a file if the PC has too little available disk space or if the free space itself is too fragmented. In these cases, you'll need to clear up more space and run a defragmenter within Windows to optimize the free space and then try PageDefrag again.
PageDefrag usually runs quickly as it's tackling only a small number of files. However, if the files are heavily fragmented, it may take some time to complete, at least the first time. After PageDefrag finishes its work, Windows loads normally. You can then open the program again to confirm that each file is now a single fragment.
You can run PageDefrag non-interactively via the command line or through a script by using the options -e Defrag boot, -o Defrag once, -n Never Defrag, and -t Set countdown to specified number of seconds with the pagedfrg.exe file.
To learn more and download a copy, visit microsoft.com/technet/sysinternals/FileAndDisk/PageDefrag.mspx.

Lance Whitney is an IT consultant, trainer, and technical writer. He has spent countless hours tweaking Windows workstations and servers. Originally a journalist, he took a blind leap into the IT world 15 years ago.
© 2008 Microsoft Corporation and CMP Media, LLC. All rights reserved; reproduction in part or in whole without permission is prohibited.
Page view tracker