How to use the Inbox Repair tool to recover email messages in Outlook

If you are a Small Business customer, find additional troubleshooting and learning resources at the Support for Small Business site.
For a Microsoft Outlook 2000 version of this article, see
197316 .
For a Microsoft Outlook 2000 (IMO) version of this article, see
197315 .
For a Microsoft Outlook 98 version of this article, see
181325 .

Summary

You can use the Inbox Repair tool (canpst.exe) to recover folders and items from a corrupted Personal Folders file (.pst) or Offline Folder file (.ost) in Microsoft Outlook 2010, Outlook 2007, Outlook 2003, and Outlook 2002. Scanpst.exe is installed automatically when you install Microsoft Office or Microsoft Outlook. Scanpst.exe is not available as a download.

This article describes what the Inbox Repair tool does and how it validates and corrects errors in a .pst or .ost file.

How to use the Inbox Repair tool

To recover folders and items from your corrupted .pst or .ost file by using the Inbox Repair tool, use the following steps.


Video: How to repair your Outlook Person Folder (.pst) files



Note The examples in the following sections show how to use the Inbox Repair tool on a .pst file, but you can use the same procedures for an offline folder (.ost) file.

Click to expand Step 1: Run the Inbox Repair tool to diagnose and repair errors
To recover your data, you must first run the Inbox Repair tool. For more information about how to run the Inbox Repair Tool, click the following article number to view the article in the Microsoft Knowledge Base:
272227 How to find and run the Inbox Repair tool in Outlook
Note If you are using Outlook 2002 or if you are using a .pst file in Outlook 2003 that was created in an earlier version, the Inbox Repair tool may not work if your .pst file is close to the 2-GB size limit. Therefore, check the file size before you continue. Depending on the version of Windows that you are running, your .pst file might be located in one of the following folders.

Windows 7 or Windows Vista: disk drive:\users\username\AppData\Local\Microsoft\Outlook

Windows XP and Windows 2000: disk drive:\Documents and Settings\username\Local Settings\Application Data\Microsoft\Outlook

If the file is close to the 2-GB size limit, you can use the PST/OST cropping tool to make the file smaller. For more information about the PST/OST cropping tool, click the following article number to view the article in the Microsoft Knowledge Base:
296088 Oversized PST and OST Crop tool



To find and run the Inbox Repair tool manually, follow these steps:
  1. Exit Outlook.
  2. Scanpst.exe is a hidden file on your computer, so make sure that the Show hidden files and folders setting is enabled in your folder options. To check this setting, follow these steps:
    1. In Windows 7 and Windows Server 2008, click Start, type Folder Options in the Search box, and then click Folder Options.


      In earlier versions of Windows, click Start, type Control Folders, and then click OK.


      Note If you are running Windows Vista, right-click Control Folders, and then click Run as administrator. Then double-click Folder Options.
    2. Click the View tab.

      Folder Options
    3. Under Hidden files and folders, make sure that the Show hidden files and folders check box is selected, and then click OK.
  3. Click Start, and then click Find or Search, depending on which version of Windows that you are running.
  4. In the Search box, type Scanpst.exe. If you cannot find the Scanpst.exe file by using Find or Search, check the following locations for the file. Where the file is located depends on which version of Windows that you are running:
    • disk drive:\Program Files\Microsoft Office\OFFICEnn
      where nn is 10 for Office XP, 11 for Office 2003, 12 for the 2007 Office system, and 14 for Office 2010
    • disk drive:\Program Files\Common Files\System\Mapi\1033\
    • disk drive:\Program Files\Common Files\System\Mapi\1033\NT
    • disk drive:\Program Files\Common Files\System\MSMAPI\1033
    • disk drive:\Program Files(x86)\Microsoft Office\Officenn
      where nn is 10 for Office XP, 11 for Office 2003, 12 for the 2007 Office system, and 14 for Office 2010
    • disk drive:\Program Files(x86)\Common Files\System\Mapi\1033\
    • disk drive:\Program Files(x86)\Common Files\System\MSMAPI\1033
  5. Double-click the Scanpst.exe file to open the program.
  6. Click Browse to locate the .pst file.
    Note The default .pst location for Outlook 2010 on Windows 7 is disk drive:\Users\username\Documents\Outlook Files. For Outlook 2010 on Windows Server 2003 or Windows XP, the default location is disk drive:\Documents and Settings\username\My Documents\Outlook Files.
  7. Click Start. The Inbox Repair tool scans the file and reports whether it found any errors.
  8. Click OK.
After you run the Inbox Repair tool and restart Outlook, you should see a list of recovered folders in the left navigation pane in Outlook. The next step is to move the recovered items to a new Personal Folders (.pst) file in your profile. To do this, go to "Step 2: Recover the repaired items."

Click to expand Step 2: Recover the repaired items
Now that you have run the Inbox Repair tool, you are ready to recover the repaired items. To start, create a new Personal Folders (.pst) file entry in your profile. Then, you can move the recovered items to your new Personal Folders (.pst) file.
  1. After you run the Inbox Repair tool, start Outlook. If you use multiple profiles in Outlook, make sure that you select the profile that contains the Personal Folders (.pst) file that you tried to repair.
  2. On the View or Go menu, click Folder List to turn on the Folder List view.
  3. In your Folder List, you should see the followingrecovered folders:

    Recovered Personal Folders

    Calendar
    Contacts
    Deleted Items
    Inbox
    Journal
    Notes
    Outbox
    Sent Items
    Tasks

    These recovered folders are usually empty because this is a rebuilt .pst file. You should also see a folder named Lost and Found. This folder contains folders and items that the Inbox Repair tool recovered. Unfortunately, items that are missing from the Lost and Found folder may be beyond repair.
  4. Create a new Personal Folder (.pst) file in your profile. The steps may be different, depending on which version of Outlook that you are running.

    Outlook 2010
    1. Click File on the ribbon, and then click the Info tab on the menu.
    2. Click the Account Settings button, and then click Account Settings again.
    3. Click the Data Files tab.
    4. Click Add to open the Create or Open Outlook Data File dialog box.
    5. Enter a file name for your new Outlook Data (.pst) file, and then click OK.
    6. You should have a new Outlook Data (.pst) file in your profile.
    Outlook 2007
    1. On the File menu, click Data File Management.
    2. Click Add to open the New Outlook Data File dialog box.
    3. In the Types of storage dialog box, select Office Outlook Personal Folders File (.pst), and then click OK.
    4. In the Create or Open Outlook Data File dialog box, select the location and a file name for your new Personal Folders (.pst) file, and then click OK.
    5. Click OK.
    6. You should have a new Personal Folders (.pst) file in your profile.
    Outlook 2003
    1. On the File menu, point to
      New, and then click Outlook Data File.
    2. Click OK to open the Create or Open Outlook Data File dialog box.
    3. Enter a file name for your new Personal Folders (.pst) file, and then click OK to open the Create Microsoft Personal Folders dialog box.
    4. Enter a file name for your new Personal Folders (.pst) file, and then click OK.
    5. You should have a new Personal Folders (.pst) file in your profile.
    Outlook 2002
    1. On the File menu, point to New, and then click Personal Folders File (.pst).
    2. Click Create to open the Create Microsoft Personal Folders dialog box.
    3. Enter a file name for your new Personal Folders (.pst) file, and then click OK.
    4. You should have a new Personal Folders (.pst) file in your profile.
  5. Drag the recovered items from the Lost and Found folder to your new Personal Folders (.pst) file.
  6. When you have finished moving all items, you can remove the Recovered Personal Folders (.pst) file from your profile. This includes the
    Lost and Found folder.
  7. If you are satisfied with the information that you recovered, you are finished. However, if you want to try to recover additional information, go to "Step 3: Recover repaired items from the backup file."


Click to expand Step 3: Recover repaired items from the backup file
When you run the Inbox Repair tool, the option to create a backup of the original Personal Folders (.pst) file is automatically selected. This option creates a file on your computer that is named "File name.bak" (without quotation marks). This file is a copy of the original File name.pst file that has a different extension. If, after step 2, you think that you are still missing items, you can try to recover additional information from this backup file by following these steps.

Note If you could not open your original Personal Folders (.pst) file before you ran the Inbox Repair tool, the following procedures may not work. If it does not work, then unfortunately, you will be unable to recover any additional information. If you could open the file, the following procedure may help you recover additional items from your damaged Personal Folders (.pst) file.
  1. Locate the .bak file. It is located in the folder of your original Personal Folders (.pst) file.
  2. Make a copy of the .bak file and give the file a new name with a .pst extension. For example, name the file "New name.pst" (without quotation marks).
  3. Import the New name.pst file that you created in the previous step by using the Import and Export Wizard in Outlook. To do this, follow these steps:
    1. On the File menu, click Import and Export.


      Note In Outlook 2010, click the File tab on the Ribbon, click Open, and then click Import.

      Microsoft Outlook File Diagbox
    2. Click Import from another program or file, and then click Next.

      Import and Export Diagbox
    3. Click Outlook Data File (.pst), and then click Next.

      Import a File
    4. Under File to import, click Browse, and then double-click your Newname.pst file.

      Import Outlook Data File
    5. Under Options, click Do not import duplicates, and then click Next.
    6. Under Select the folder to import from, click to select the Personal Folders (.pst) file, and then click to select Include subfolders.
    7. Click to select Import folders into the same folder in, and then select your new Personal Folders (.pst).
    8. Click Finish.
    Note Remember that the backup file was the original corrupted file, and you may find that you cannot recover anything other than what was recovered in the Lost and Found folder. If you cannot import the Newname.pst file into Outlook, unfortunately you have lost all the information that is not in the Lost and Found folder.


    The Inbox Repair tool cannot repair every problem that is detected. In some cases, items may not be recovered if they were permanently deleted or corrupted beyond repair.

Advanced information

For those who are interested, this section describes exactly what the Inbox Repair tool does and how the tool validates and corrects errors in the .pst or .ost file.

What the Inbox Repair tool does

When you run the Inbox Repair tool on a Personal Folders (.pst) file, it does the following:
  • The Inbox Repair tool analyzes the Personal Folders (.pst) file directory structure and item headers to try to recover all folders and items.
  • If the Inbox Repair tool recovers the Personal Folders (.pst) file, it means that the repair tool found problems, and repaired what it could.
  • The Inbox Repair tool tries to turn any file into a Personal Folders (.pst) file. For example, if you rename an executable file to "Something.pst" (without quotation marks), the tool changes the file to a mountable .pst file.
  • The Inbox Repair tool makes a backup copy of any Personal Folders (.pst) file before you try to repair the file.

How the Inbox Repair tool validates and corrects errors

ScanPST mostly validates and corrects errors in the internal data structures of a .pst file. The .pst file is a database file. Therefore, structures such as BTrees and reference counts, are checked and repaired as necessary. These low-level objects have no knowledge of the upper-level structures, such as messages, calendar items, and so on, that are built upon them.


If ScanPST determines that a specific block of the structure or table is unreadable or corrupted, ScanPST removes it. If that block was part of a specific item in Outlook, the item will be removed when it is validated.


You may not expect this behavior, but the removal of the item is appropriate given the circumstances. Also, this specific kind of situation is rare, and it will always be entered in the ScanPST log file.


At a higher level, the more visible changes that you see involve folders and messages.


Folders

ScanPST examines every folder in the .pst and performs the following operations:
  1. ScanPST makes sure that there are the correct tables associated with the folder.
  2. ScanPST checks every row in each table and makes sure that the message or the subfolder exists in the system.
  3. If ScanPST cannot find the message or the subfolder, ScanPST removes the row from the table.
  4. If ScanPST does find the message or the subfolder, ScanPST validates the message or the folder.
  5. If that validation fails, the message or folder is considered corrupted, and it is removed from the table and deleted from the database.
  6. If the validation succeeds, ScanPST does another analysis to make sure that the now-recovered message values are consistent with the values in the table. Corrupted folders are recreated from scratch, if it is necessary. These folders contain no user data.
Messages

Most users will be concerned by message operations, because a corrupted item is likely to cause something to be deleted from the .pst file. ScanPST performs the following operations on messages:
  1. ScanPST does some basic validation of attachment tables and recipient tables. This operation resembles how a folder works with the messages in it.
  2. As soon as the recipient table is validated to guarantee recipients that are formatted correctly, ScanPST makes any changes that are required to synchronize these valid recipient table contents to the recipient properties on the message. ScanPST also guarantees that the message's parent folder refers to a valid folder. The following message properties are checked to make sure that they follow valid data formats:
    • PR_MESSAGE_CLASS

      ScanPST checks that this property exists. If the property does not exist, it is set to IPM.Note.
    • PR_MESSAGE_FLAGS

      Each flag is validated separately.
    • PR_SUBMIT_FLAGS

      This validation resembles the operation for message flags.
    • PR_CLIENT_SUBMIT_TIME

      If the submit flags indicate that the message is marked as submitted, this property must exist. If the submit flags do not indicate that the message is marked as submitted, the time is set to Now.
    • PR_SEARCH_KEY

      This property must exist. If the property is not present, a random GUID is generated for it.
    • PR_CREATION_TIME

      This property must exist. If the property is not present, the time is set to Now.
    • PR_LAST_MODIFICATION_TIME

      This property must exist. If the property is not present, the time is set to Now.
    • PR_MESSAGE_SIZE

      Sizes are recalculated and compared to stored values. If sizes differ by some delta, the calculated value is written.
    No validation is explicitly done on body-related properties or on subject-related properties, except the implicit low-level validation that this article discusses earlier. The recipient display properties are changed to be consistent with the recovered recipient table. As soon as this operation is complete, other algorithms are run to collect all the orphaned messages and to put them in an Orphans folder.


    For more information about binary trees (btrees), go to the following Microsoft website:
Properties

Article ID: 287497 - Last Review: Sep 12, 2013 - Revision: 1

Feedback