• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Outlook Tips

Learning Microsoft Outlook One Tip At A Time

Outlook 2013 Absolute Beginner's Guide Diane Poremsky [Outlook MVP]

  • Home
  • Tips Archive
  • How to...
  • Beginner
  • Outlook 2016
  • Outlook.com
  • Outlook on Windows 10

Tip 915: Compact Now Every Time you Exit Outlook

A reader wanted to know if he could configure Outlook to automatically compact the pst every time he closes Outlook.

Yes, this is possible, using the PSTNullFreeOnClose registry key. This can lengthen the time it takes Outlook to shutdown and if Outlook is forced closed during the compaction process the data file could become corrupt. If you use both this key and the option to empty deleted items on exit, Outlook will take much longer to exit.

However, this setting can be useful to security conscious users as compacting removes all traces of deleted messages, making it impossible to recover the mail.

How Outlook works: when you delete an item and empty the deleted item folder, the messages (and other items) are removed from the index but left in the data file. The space used by these deleted messages is called “white space”.  Until Outlook recovers this space, it may be possible to recover deleted messages using recovery software.  Outlook will automatically compact the data file when the “white space” reaches around 20% of the data file’s size and the computer is idle. Because it runs as a background service, it can take days for Outlook to fully compact the pst file. (This is a great reason to keep Outlook open when the computer is running.)

If you deleted a lot of messages and don’t want to wait for Outlook to get around to it, you can recover the free space by running Compact Now.  To do this, right click on the top level of the data file and choose Properties, then click the Advanced button and Compact Now. Keep in mind that it can take a long time to compact a large data file.

compact manually

If you want to force Outlook to return this free space every time that you close Outlook, you can add PSTNullFreeOnClose to the registry.

Outlook 2010

HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\PST
DWORD: PSTNullFreeOnClose
Value: 1 = compact on close;  0 = don’t compact

Outlook 2007

HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\PST
DWORD: PSTNullFreeOnClose
Value: 1 = compact on close;  0 = don’t compact

Outlook 2003

HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\PST
DWORD: PSTNullFreeOnClose
Value: 1 = compact on close;  0 = don’t compact

This key was introduced in an update for Outlook 2000 and works in all versions of Outlook that are updated with the latest service pack.

Registry editor

This key works on both pst and ost files. With the value set to 1, deleted data is removed when you close Outlook. When it’s set to 0 or deleted, the data file will not be compacted on close.

Note that the first time you close Outlook after making this change, it may take a long time for Outlook to close.

Don't want to edit the registry? We have reg files you can download and run:

Outlook 2010Outlook 2007Outlook 2003

Published September 22, 2011. Last updated on November 13, 2014.

Share this:

  • Twitter
  • Facebook
  • LinkedIn
  • More
  • Print
  • Tumblr
  • Reddit
  • Pocket
  • Pinterest

Related posts:

Outlook 2010 (and 2007, 2013) gets the maximum message size from Exchange server and prevents you from sending the message insteadTip 750: Outlook 2010 and large messagesOutlook's desktop alertTip 245: Outlook's Desktop Alerts SettingsMany of the Most Recently Used (MRU) lists in Outlook can be deleted by editing the registry. Quit Outlook then open the registryTip 28: Outlook's MRU listsOutlook iconTip 726: Outlook 2010: Prompt before deleting

12
Leave a Reply

2500
wpdiscuz_captcharefresh
8 Comment threads
4 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
9 Comment authors
2500
wpdiscuz_captcharefresh
  Subscribe  
newest oldest most voted
Notify of
CMAR606

But using imap you dont have to do this step right?

pps, are you an IMAP kinda gal or POP3 kinda gal?

Vote Up0Vote Down  Reply
May 3, 2015 7:26 pm
D Poremsky

You can compact IMAP data files, although I don't think I would. (I didn't test the key with IMAP but it should work. )

I use both but my main account is Exchange mailbox. :)

Vote Up0Vote Down  Reply
May 3, 2015 10:14 pm
Colin A

Hi there, very interesting article, it has been a big help.. You say that when Outlook is idle it runs the Auto Compact process... Do you know the name of this process or where I can find it...?

Vote Up0Vote Down  Reply
April 25, 2015 1:33 pm
D Poremsky

I never looked for the process - i assume it's internal to outlook, not a separate process.

Vote Up0Vote Down  Reply
April 26, 2015 12:54 am
sunk818

Perhaps the tip is pre-Outlook 2013. Does this work in Outlook 2013 by editing the Outlook 2010 reg file so it is 15.0 instead of 12.0?

Vote Up0Vote Down  Reply
November 13, 2014 6:16 pm
D Poremsky

It is a pre-2013 tip. Yes, changing the version # to 15 should work. (I'll double check it though and post an outlook 2013 reg file.)

Vote Up0Vote Down  Reply
November 13, 2014 8:10 pm
Stephane

This does not compact the .pst file, but it «shreds» the deleted messages, so you cannot recover them for security reasons. I have tried it, and my PST was bigger after closing.

Vote Up0Vote Down  Reply
May 31, 2012 6:19 am
Diane Poremsky

Every test I made showed the pst shrunk, although sometimes by very little. I don't recommend doing this on close - it can take too long. I prefer to let Outlook compact automatically as it has idle time. Either way, the deleted items will be totally unrecoverable after compacting.

Vote Up0Vote Down  Reply
May 31, 2012 8:20 am
Diane Poremsky

No, it is not affected by the windows version.

Vote Up0Vote Down  Reply
February 1, 2012 5:51 pm

Primary Sidebar

Subscribe to Outlook Tips by Email

Search OutlookTips

Training and one-on-one assistance

Do you need help setting up Outlook or want some one-on-one training? I'm available for hire. See Training and one-on-one assistance for fees and to check availability.

Popular Posts

  • Popular
  • Latest
  • WeekMonthAll
  • How to start Outlook in safe modeHow to start Outlook in safe mode
  • Can't Print in Outlook?Can't Print in Outlook?
  • Change Outlook's Open or Save Attachments FolderChange Outlook's Open or Save Attachments Folder
  • Where is File tab in Outlook?Where is File tab in Outlook?
  • How to Find Folder Paths in Outlook MailboxesHow to Find Folder Paths in Outlook Mailboxes
  • Icons found in the Inbox, Message Headers, and ToolbarsIcons found in the Inbox, Message Headers, and Toolbars
  • How to Reset the View on Outlook foldersHow to Reset the View on Outlook folders
  • Turn Off the Metered Network Warning in OutlookTurn Off the Metered Network Warning in Outlook
  • Setting a fixed Column Width in OutlookSetting a fixed Column Width in Outlook
  • Outlook 2016’s Attachments icons are hugeOutlook 2016’s Attachments icons are huge
  • Outlook & iCloud: Your setup couldn't be started because the iCIoud server stopped responding.Outlook & iCloud: Your setup couldn't be started because the iCIoud server stopped responding.
  • Create an appointment from a message in Outlook on the webCreate an appointment from a message in Outlook on the web
  • What happens to Outlook.com account when a family member dies?What happens to Outlook.com account when a family member dies?
  • Too much white space in OutlookToo much white space in Outlook
  • Prevent Accidentally Sending an Email MessagePrevent Accidentally Sending an Email Message
  • Change your password in Outlook 2016Change your password in Outlook 2016
  • Can't Print in Outlook?Can't Print in Outlook?
  • iCloud Contacts are not showing in Address BookiCloud Contacts are not showing in Address Book
  • Autocomplete only uses the first letters of a nameAutocomplete only uses the first letters of a name
  • Drag to Reorder the To-Do ListDrag to Reorder the To-Do List
Ajax spinner

Footer

You Might Like

Using Two-factor authentication in Outlook
How to install Outlook on a Netbook
Outlook's Missing Holidays
Where are my Outlook Files?
How to use Outlook's Command line switches

Resources

Ask questions and share your knowledge in Outlook Forums.

Most Commented Articles

  • Delete a message stuck in Outlook's Outbox (310)
  • Using Microsoft Outlook's Forms Designer (106)
  • How to use Scanpst.exe to repair Outlook data files (102)
  • Outlook's Missing Holidays (97)
  • Calendar Detail View in Outlook (78)
  • How to start Outlook in safe mode (62)
  • How to Find Folder Paths in Outlook Mailboxes (57)

© 2019 · Outlook Tips

wpDiscuz