Using the Document Defragmenter utility
The ArcGIS Document Defragmenter utility defragments the storage inside an .mxd file to potentially reduce the file size. This utility is useful if your .mxd files are large in size. The utility can also defragment .sxd, .3dd, and, .mxt files. The utility is located in the Utilities folder of the ArcGIS Desktop installation directory. By default, that location is <install path>:\Program Files\ArcGIS\Desktop10.0\Tools.
You can defragment a single document file, all ArcGIS documents in a particular folder, or all documents found in folders beneath a point in the file tree. There are different options for placement of the defragmented documents. By default, a new document file is created in the same folder as the original file and the name of the new file is the same as the original file name with _Defrag appended to it. For example, if you defragmented JoshuaTreeNP.mxd, the new file is JoshuaTreeNP_Defrag.mxd.
The file handling during defragmentation proceeds as follows:
- The defragmented file is made using _Defrag at the end of its file name.
- If appropriate to the file handling option chosen, the original file has its extension changed to .old.
- If appropriate, the defragmented file is renamed using the original file name.
- If appropriate, the original file is deleted.
This utility is provided as a courtesy to help repair problematic fragmented .mxds. Create a backup copy of the original file before using the Document Defragmenter.
The ArcGIS Document Defragmenter utility can be run as a command from the MS-DOS prompt. The usage is as follows:
DocDefragmenter <full source file path> <full target file path>
No message or success status is returned from this command; therefore, the success of the operation can only be determined by the existence of the target file.
-
Run DocDefragmenter.exe.
The ArcGIS Document Defragmenter dialog box opens as shown here:
- Choose a file selection option.
- Click Single file to defragment a single document file.
- Click Folder to defragment all ArcGIS document files in a particular folder.
- Click Folder and all subfolders to defragment all ArcGIS document files in a particular folder and recursively under all its subfolders.
- Click Select and navigate to the single document file (such as an .mxd) or the folder that contains document files.
- Choose a file handling option; this determines how the defragmented file is named. The options are as follows:
- Leave the original file as it is and create the new defragmented file with _Defrag appended to the original file name.
- Replace the original file with the defragmented file. Change the extension of the original file to .old.
- Overwrite the original file. Caution:
You must ensure that there are backup copies of the original file (as well as all .mxd files in the folders selected) if you choose this option.
- Click OK to start the defragmentation on the selected files.
- Click Exit to close the application.
The specified files should now be less fragmented and take up less disk space.
It is possible that the defragmentation may fail due to file access permissions. If this happens, you can deduce the problem with the help of the error message and the files left behind by the process.