Deleting Cache in Classic Outlook

3 minutes
10 hours ago

Due to Microsoft limitations, enabling Force email filing in Classic Outlook requires additional steps:

Force Email filing: Available in Newforma 2025.2

  1. If users in Classic Outlook don’t see the Force email filing changes after 72hrs, we advise them to delete the cache in Outlook. It could be done individually or via Admin.
    • Delete cache individually:
      1. Close Classic Outlook and all its instances.
      2. Go to Windows-> Run command → Enter %userprofile%\AppData\Local\Microsoft\Outlook\HubAppFileCache and press Enter
      3. Delete the folders.
      4. Follow same steps above and in Run command → Enter %LOCALAPPDATA%\Microsoft\Office\16.0\Wef\
      5. Delete the folders
      6. Restart Outlook

How to clear cache via group policy

Create a script to clear the office cache.

  1. Open a notepad on your system and copy/paste this into it.
    • NOTE: Under “$paths”, you can add additional cache locations to clear if needed.
# Clear Outlook Cache
$paths = @(
  "$env:LOCALAPPDATA\Microsoft\Office.0\WEF",
  "$env:USERPROFILE\AppData\Local\Microsoft\Outlook\HubAppFileCache"
)

# Stop apps so files aren't locked
$procs = 'winword','excel','powerpnt','outlook','teams','onenote'
Get-Process $procs -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue

foreach ($p in $paths) {
  if (Test-Path -LiteralPath $p) {
    Get-ChildItem -LiteralPath $p -Force -Recurse -ErrorAction SilentlyContinue |
      Remove-Item -Force -Recurse -ErrorAction SilentlyContinue
  }
}

2. Save this file as something descriptive. For this example, we named it “delete outlook cache.ps1

3. It is recommended you test this script on your system locally to verify it works before deploying it.

Create a group policy to deploy the script to users.

  1. On an Active Directory Domain Controller (DC), open Group Policy Management.
  2. Under “Group Policy Objects“, Right-click and select “New“.
  3. Provide a name for the new policy object
  4. You should now see a new object appear under the “Group Policy Objects“ folder where you created it. Click and drag the policy you created to an OU to link it. For this example, we used “Manchester Production“.
  5. Once linked, Right click on the object to edit it.
  6. In the window that opens, navigate to User Configuration > Windows Settings > Scripts (Logon/Logoff) and then select “Logon“ in the right pane.
  7. In here, add the script you created in step 1 of the first section and click “Apply“ and then “OK“.

Verify

  1. To verify this works, log in to a system with Outlook installed on it with an account that was included in the OU you linked earlier.
  2. Open command prompt on the system and run “gpupdate /force“
  3. Then, logout and back in.
  4. You should now see the locations you added in the script have been cleared.

For this script to trigger, users will need to logout and back into the system.