Home    Blog

Force Outlook to create new OST file in another location

Microsoft Outlook email defaults to storing the OST file  C:\users\****\Appdata\local\Microsoft\Outlook folder.   The OST file is offline storaage table and it can get big.  It allows a user to access emails without staying connnected.   My C drive is a small 100 GB SSD and where windows runs from.   I am running out of space and found that the OST file was a big chunk ~8 GB.   I tried several methods to have outlook store it on my D drive.   The thread below is the only one that worked.  The biggest hint here is to NOT use MS outlook to create the account.  Use the mail applet in control panel  (more info here Gmail Server Settings that worked for manual setup)
Excerpt and my notes:
 I did managed to move the .ost data file from
C:\users\****\Appdata\local\Microsoft\Outlook to G:\Users\***\Documents\Outlook Files for an IMAP account following the next steps;

  1. Removed the email account from Outlook, (the Data File will be removed by default). The email account and Data File MUST be removed before you create the ForcePSTPath key AND the ForceOSTPath!
  2. Close Outlook
  3. Deleted the file in C:\Users\Username\AppData\Local\Microsoft\Outlook\email address.ost file.
  4. Opened the Registry, navigated to HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook  (see note below about outlook version)
  5. I created both the String Value:ForcePSTPath key AND the ForceOSTPath and the Value data to read D:\Users\Username\Documents\Outlook Files as value type: REG_EXPAND_SZ
  6. Powered off the pc.  (I didn't need to do this step)
  7. Powered on the pc  (I didn't need to do this step)
  8. Opened Control Panel > Mail > E-mail accounts > Account settings > New and added the IMAP account Manually (Do not use Add new mail account from within Outlook!)
  9. When the account was added the Data File was created in the D\:Users\Username\Documents\Outlook Files
  10. Open Outlook and it will update the account.

Method 1: Registry Editor to Change OST File Location

With the use of Registry Editor, one can change default location of OST file irrespective the versions of Outlook. For the same, follow the steps mentioned below:

  • First of all, press Windows + R key to open Run dialog box. Then, type Regedit in the box and click on OK button.
  • The Registry Editor will get opened. After that, you need to choose the key according to the version of Outlook.

In the case of Outlook 2016, the key is
HKEY_CURRENT _USER\Software\Microsoft\Office\16.0\Outlook
In the case of Outlook 2013, the key is
In the case of Outlook 2010, the key is
In the case of Outlook 2007, the key is

  • On the right-hand side of the registry editor, click on the empty area. Then, click on the New followed by the Expandable string value.
  • Creation of new value takes place. In the Edit String dialog box, click Force OST path. A new default location has to be added where the OST file can be stored. At the last, click OK.
Another site with moving outlook OST file but I didn't want to go the symbolic link method.

Creating Symbolic Links

Symbolic Link buttonTo create a Symbolic Link, you can use the MKLINK Command line tool or the New-Item PowerShell (version 5 or later) cmdlet. Whichever method you pick, the result is the same.

In the example below, we assume that the name of the ost-file is outlookcom.ost and that we move it from its original location to a location called D:\Documents\Outlook Files

  1. Close Outlook.
  2. Move the ost-file or pst-file from its original location to its new location.
    The default location is; C:\Users\%username%\AppData\Local\Microsoft\Outlook
  3. Open an elevated Command or PowerShell window.
    A quick way to do this is;
    1. Open the Start Menu and immediately type one of the following;
      • Command Prompt
      • PowerShell
    2. Right click on the result and choose; Run as administrator
    3. Provide administrator credentials for your computer or press "Yes” to accept the User Account Control prompt.
  4. Type one of the following commands (of course with your own file names and locations) depending on whether you are using the Command Prompt or PowerShell;
    • Command Prompt
      mklink "C:\Users\%username%\AppData\Local\Microsoft\Outlook\outlookcom.ost" "D:\Documents\Outlook Files\outlookcom.ost"
    • PowerShell
      New-Item -ItemType SymbolicLink -Path "C:\Users\%username%\AppData\Local\Microsoft\Outlook\outlookcom.ost" -Value "D:\Documents\Outlook Files\outlookcom.ost"

You can actually leave the variable %username% in your command. Upon executing, the command it will automatically resolve it to your actual username.

Once you’ve created the symbolic link, the file icon will look like a shortcut in Explorer. However, instead of having the Shortcut file type, it still holds the ost-extension and the "Outlook Data File” file type (Windows 7) or the ".symlink” file type (Windows 10).

Its file size will report as 0KB but the file it is pointing to of course still holds its size; The link to that file simply doesn’t take up any disk space.

Comparison between the properties and look of a Symbolic Link, Shortcut and the original.
Comparison between the properties and look of a Symbolic Link,
Shortcut and the original file (which is marked with 2 in the name).

Undoing the changes
When you want to undo the changes, simply close Outlook, delete the Symbolic Link file like and other file and then move the ost-file back to its original location.

Creating Symbolic Links via a GUI based tool

Tools buttonAside from the command line tools provided by Microsoft, you can also use a free 3rd party tool to create Symbolic Links via a user interface (GUI).

  • Link Shell Extension
    This tool works for all Windows versions and supports the creation of a Symbolic Link, Junction, Volume Mountpoint, Smart Copy, DeLorean Copy, Hardlink Clone and Symbolic Link Clone via a GUI.