Fix: You Cannot Delete this Outlook Data File

Several users have been encountering the “You Cannot Delete this Outlook Data File” error when trying to get rid of a bad Outlook Data file or to remove an Exchange account from Outlook. This particular issue is reported to occur with multiple Outlook versions including Outlook 2003, Outlook 2010, and Outlook 2016.

You Cannot Delete this Outlook Data File

What is causing the “You Cannot Delete this Outlook Data File” error?

We studied this particular error message by taking a look at various user reports and the repair strategies that most affected users have deployed in order to get the issue resolved. As it turns out, there are several common scenarios that are known to trigger this particular error message:

  • Outlook (or a different email client) is using the data file – This is undoubtedly the most common scenario. The majority of users fail to delete the Outlook data file because Outlook is opened and is using it actively. If this case is applicable, the fix is as simple as closing the email client (Outlook or other). Another approach is to close the PST / OST file from Outlook directly.
  • Corrupted Outlook profile – Another scenario that might trigger this particular issue is a corrupted Outlook profile. If the PST / OST file contains bad data, you might be prevented from deleting it conventionally. In this case, you might be successful by deleting the data file manually or by deleting the entire Outlook profile.

If you’re currently struggling to resolve this particular error, this article will provide you with several troubleshooting steps. Down below, you’ll find five different methods that affected users all over the world have successfully used to resolve the issue.

Not every potential fix will be applicable to your particular scenario, so we urge you to follow the methods in the order that they are presented and skip those that aren’t applicable.

Method 1: Close Outlook

If you receive this error message while trying to delete the Data file, you should start investigating if any instance of Outlook is currently running on your computer. Or it could be a different email client that is using the same Data file.

Keep in mind that if Outlook.exe or a different application is running and is actively using the Data file, you’ll keep seeing the “You Cannot Delete this Outlook Data File” error because the file is in use.

With this in mind, open up your Task Manager (Ctrl + Shift + Esc), go to the Processes tab and see if you see any evidence of an Outlook process that is currently running. If you see one, simply right-click on it and choose End Task.

Ending the Outlook task

If this method wasn’t applicable and all your email clients we’re already closed, move down to the next method below.

Method 2: Closing the PST / OST file from Outlook (Outlook 2013 and older only)

Several users that we’re encountering the issue on Outlook 2010 and Outlook 2013 when trying to import an Outlook 2003 file have reported that the issue was resolved after they right-clicked on the PST / OST file from the main Outlook screen and clicked on the Close option.

Closing the PST / OST file from the main Outlook menu

After confirming at the warning prompt, affected users have reported that the Data file could be deleted without encountering the “You Cannot Delete this Outlook Data File” error.

Note: This method will not be applicable on versions newer than Outlook 2013.

If this method wasn’t applicable or you’re looking for a different approach of resolving the problem, move down to the next method below.

Method 3: Removing the Outlook profile

Some users that we’re encountering the “You Cannot Delete this Outlook Data File” error have managed to resolve it by removing the Outlook profile in which the account is configured. This route might be a little more intrusive than the other fixes, but it’s known to fix the issue in most cases.

The only inconvenient is that you will lose any data currently stored on the Outlook profile. If you decide to go through with it, here’s what you need to do:

Note: You should be able to follow the steps below regardless of your Windows version.

  1. Close Outlook Completely and any associated service.
  2. Press Windows key + R to open up a Run dialog box. Then, type “control.exe” and press Enter to open up the classic Control Panel interface.
    Running Control Panel
  3. Once you’re inside Control Panel, use the search function (top-right corner) to search for “mail“. Then, click on Mail (it’s typically the only result).
    Opening up the Mail app
  4. Once you see the Mail Setup window, click the Show Profiles button associated with Profiles.
    Accessing the Profiles menu
  5. Inside the Mail window, simply select the Outlook profile tied to the data file that is giving you issues and click on Remove.
    Removing the Outlook Profile
  6. Hit Yes at the confirmation prompt to remove your profile.
  7. Restart your computer and see if you’re able to delete the Outlook data file without receiving the “You Cannot Delete this Outlook Data File” error.
    Note: The next time you open Outlook, the email client will create you a new OST/PST file along with a new profile right after you sign in with your email credentials. So there’s no need for you to input them manually inside the Mail screen.

If this method is not applicable or you’re looking for a different approach, move down to the next method below.

Method 4: Deleting the PST / OST file manually

Some users have been able to resolve the “You Cannot Delete this Outlook Data File” error by deleting the PST file manually. This can be done by accessing the AppData folder and deleting it conventionally. But in order for this to be successful, you’ll need to ensure that the data file is not being used by Outlook or another email client.

Here’s a quick guide on deleting the PST file manually:

  1. Open File Explorer and navigate to the following location:
    C:\ Users \ *YourUser* \ AppData \ Local \ Microsoft \ Outlook

    Note: If the AppData folder is not visible, access the View tab (of File Explorer) from the ribbon bar at the top and make sure that the box associated with Hidden Items is checked.

  2. Once you get to that location, simply right-click on it and choose Delete to get rid of it. You should be able to do so without encountering the “You Cannot Delete this Outlook Data File” error.
    Deleting the PST / OST data file

Method 5: Deleting all email accounts via Registry Editor

If you’ve come this far without a satisfactory solution, one radical resolution is to simply delete all mail accounts from your system. This will ensure that no email account will actively use the Data file, which will allow you to delete it without encountering the “You Cannot Delete this Outlook Data File” error.

But keep in mind that going this route will also remove any locally stored data related to your email accounts connected through Outlook. Obviously, you’ll also need to set up your accounts all over again.

If you decide to go with this radical solution, here’s what you need to do:

  1. Press Windows key + R to open up a Run dialog box. Then, type “regedit” and press Enter to open up the Registry Editor. When prompted by the UAC (User Account Control), click Yes to grant administrative privileges.
    Running the Registry Editor
  2. Once you get inside the Registry Editor, use the left-hand pane to navigate to the following location:
    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows

    Note: If you can’t find this exact key, it means that this method is not applicable to your particular scenario.

  3. Right-click on Windows Messaging Subsystem and choose Delete
Deleting the Windows Messaging Subsystem

Once the Windows Messaging Subsystem key is deleted, all mail account data will be removed. Just restart your computer and you will no longer encounter the “You Cannot Delete this Outlook Data File” error when trying to delete the data file.

ABOUT THE AUTHOR

Kevin Arrows


Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.