Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Repair Outlook PST Files by Running Command

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can repair Outlook PST files by running the built-in Scanpst.exe command from the command line. This tool checks the file for errors and fixes corruption without needing extra software. Before you start, close Outlook completely and make sure you know the full path to your PST file. The steps below work for Windows 10 and 11, and the command is the same for all recent Outlook versions.

What You'll Need

  • Administrator access to your Windows PC (to run the command prompt as admin).
  • The exact file path to your PST file. If you don't know it, open Outlook, go to File > Account Settings > Account Settings, select the Data Files tab, and note the location shown.
  • Enough free disk space – the repair tool creates a backup copy, so ensure you have at least double the size of the PST file available.

Step-by-Step

  1. Close Outlook completely. Check the system tray (bottom-right corner) for any Outlook icon and right-click > Exit if present. The repair tool cannot run while Outlook is using the file.
  2. Find Scanpst.exe. The tool is installed with Office. The default locations are:
    For 64-bit Office: C:\Program Files\Microsoft Office\root\Office16\Scanpst.exe
    For 32-bit Office: C:\Program Files (x86)\Microsoft Office\root\Office16\Scanpst.exe
    The Office16 folder is used for Outlook 2016, 2019, 2021, and Microsoft 365. If you have an older version, it might be Office15 or Office14. If you can't find it, search Windows for “Scanpst”.
  3. Open Command Prompt as Administrator. Press Windows key, type cmd, right-click “Command Prompt” and select “Run as administrator”. Click “Yes” if prompted.
  4. Run the command. Type the full path to Scanpst.exe in quotes, then press Enter. For example:
    "C:\Program Files\Microsoft Office\root\Office16\Scanpst.exe"
    The repair tool window will open.
  5. Enter the PST file path. In the tool, click “Browse” and select your PST file, or type its full path manually (e.g., C:\Users\YourName\Documents\Outlook Files\archive.pst).
  6. Start the scan. Click “Start”. The tool will scan the file. This can take a few minutes for large PSTs. You’ll see a progress bar.
  7. Review the results. After the scan, the tool shows a summary of errors found. If there are errors, click “Repair”. The tool will fix them and create a backup file with a .bak extension in the same folder.
  8. Restart Outlook. Once the repair is complete, open Outlook and check if your emails, contacts, and calendar items are accessible.

Common Mistakes

  • Running the command while Outlook is open. This will cause the repair to fail or produce errors. Always close Outlook first.
  • Using the wrong Scanpst.exe path. If you have 32-bit Office on a 64-bit Windows, the path is different. Double-check the folder name (Office16 vs Office15).
  • Typing the PST path incorrectly. Spaces in folder names require quotes around the entire path. If you get “file not found”, copy the path from Outlook’s Data Files tab.
  • Skipping the backup. The tool automatically creates a .bak file, but if the repair goes wrong, you might need it. Don’t delete it until you’re sure everything works.

Tips

  • Always run a scan before attempting any manual PST edits. It’s the safest first step.
  • If the PST is very large (over 20 GB), consider splitting it – but only after a successful repair.
  • Use the /f switch? No – Scanpst.exe doesn’t support command-line switches for repair. You must run the tool interactively. The command line only launches the GUI.
  • If the tool finds errors but can’t repair them, try running it again – sometimes multiple passes are needed.
  • Keep your PST file size under 50 GB (Outlook’s recommended limit) to reduce corruption risk.

Troubleshooting

If the command doesn’t start Scanpst.exe: Check that the path is correct. If you get “The system cannot find the path specified”, try searching for Scanpst.exe in File Explorer. If it’s not there, your Office installation might be damaged – run Office Repair via Control Panel > Programs > Microsoft Office > Change > Quick Repair.

If the repair tool says “The file is not a valid PST file”: This usually means the file is severely corrupted or the extension is wrong. Try renaming the file to .pst (if it wasn’t) and run again. If that fails, you may need third-party recovery software – but try the built-in tool first.

If Outlook still shows errors after repair: Close Outlook, run Scanpst.exe again. If errors persist, the PST might be beyond repair. Create a new PST and import your data from the .bak file (if created) or from an earlier backup.

If the repair tool freezes or takes too long: Be patient – it can take 30 minutes for a 10 GB file. If it’s stuck for over an hour, close it and try again in Safe Mode (restart Windows in Safe Mode, then run the tool).

Frequently Asked Questions

Can I repair a PST file without Scanpst.exe?

Yes, you can use third-party tools, but Scanpst.exe is free and built into Office. It should be your first choice.

Does Scanpst.exe work on OST files?

No, Scanpst.exe is for PST files only. For OST files, you typically recreate the mailbox or use the built-in “Repair” option in Outlook if it’s an IMAP account.

Will repairing a PST file delete my emails?

No, the repair process fixes the file structure and should preserve your data. However, it creates a backup .bak file just in case.

How long does the repair take?

It depends on the file size. A 1 GB file might take 5 minutes; a 20 GB file could take an hour or more.

Can I run Scanpst.exe from a USB drive?

Yes, you can copy the tool to a USB drive and run it, but the PST file must be accessible on the same computer. Running it from a USB might be slower but works.

What if I don’t know the PST file path?

Open Outlook, go to File > Account Settings > Account Settings > Data Files tab. The path is listed there. You can also search for *.pst in File Explorer.