• Outlook User
  • New Outlook app
  • Outlook.com
  • Outlook Mac
  • Outlook & iCloud
  • Developer
  • Microsoft 365 Admin
    • Common Problems
    • Microsoft 365
    • Outlook BCM
    • Utilities & Addins

Open Outlook Folders using PowerShell or VBScript

Slipstick Systems

› Developer › PowerShell › Open Outlook Folders using PowerShell or VBScript

Last reviewed on July 24, 2023     2 Comments

An Outlook user had a question:

I have mail sorted into folders in a separate data file. There is one folder that I need to be able to access quickly. Is there was a way to create a link or a shortcut to that folder on my desktop? I researched this, but it all seemed overly complicated and referred to older versions. Is there is a simple solution?

Older versions supported created links to folders on the Windows desktop, however, Microsoft removed this option about 20 years ago. You have a couple of options within Outlook though:

  1. Add the most used folders to the Mail Favorites in Outlook. If you aren't showing the Favorites list, enable it from the View tab > Folder Pane button. Then right-click on a folder and choose Add to Favorites to add it. To remove a folder from Favorites, right-click the folder and choose Remove from Favorites. (You can drag and drop too.)
    Show Favorites Mail panel
  2. Use VBA to open the folder and add buttons to the ribbon (or QAT) to run the VBA. If you have several folders you want to open, you can create a custom ribbon for the buttons.

If you really want a shortcut on the desktop, you can use PowerShell or VBScript to open the folder. Save the .ps1 script to a folder and add a shortcut to the desktop.

The advantage of either PowerShell or VBScript over VBA is that you do not need to change macro security settings.

PowerShell to Open an Outlook Folder

This PowerShell opens a sub folder of the Inbox. When Outlook is open, the only con is that a black PowerShell screen flashes momentarily when you run it. (It will open Outlook if it is closed.)

To use, paste into Notepad, change the datafile display name and folder name then save with .ps1 extension to your desktop. Right-click on the script and choose Run with PowerShell. If you want to open the PowerShell file with a double click, create a windows shortcut (the steps are after the PowerShell script samples)

$olApp = new-object -comobject outlook.Application 
$namespace = $olApp.GetNamespace("MAPI") 

#Folder is in another datafile, at the same level as Inbox.
$currentExplorer = $namespace.Folders.Item("Data File Display Name").Folders.Item("Keep")

$currentExplorer.Display()
 
$olApp.Quit | Out-Null 
[GC]::Collect()  

Use this format if the folder is in the default data file, at the same level as the Inbox.

$currentExplorer = $namespace.GetDefaultFolder(6).Parent.Folders("Keep")

Use this if the folder is a subfolder of the Inbox

$currentExplorer = $namespace.GetDefaultFolder(6).Folders("Test") 

Create a shortcut to run the script

  1. Right-click on the ps1 file and create a shortcut to it.
  2. Right-click on the shortcut and choose Properties.
  3. In the Targe field, add powershell.exe -F in from to the file path and put quotes around the file path.
  4. The Target should look like this if you look at the Properties after saving it: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -F "C:\path\to\script\name.ps1"
    Shortcut to open PowerShell script
  5. Apply and close the shortcut.
  6. Move the shortcut to the desktop.

VBScript to Open an Outlook Folder

If you prefer to use VBScript, paste this code into Notepad, change the datafile display name and folder name then save with .vbs extension.

Set oOutlook = GetObject("","Outlook.Application")
Set oName = oOutlook.GetNamespace("MAPI")
Set oFolder = oName.Folders.Item("Data File Name").Folders.Item("Keep")
 
 oFolder.Display

As with PowerShell, use this format if the folder is in the default data file, at the same level as the Inbox.

Set oFolder = oOutlook.GetDefaultFolder(6).Parent.Folders("Keeps") 

Double click to run the VBS file or shortcut to the VBS file.

Open Outlook Folders using PowerShell or VBScript was last modified: July 24th, 2023 by Diane Poremsky

Related Posts:

  • Create new Outlook folders using PowerShell
  • Shortcuts to open Outlook folders
  • Set Outlook Online or Offline using VBScript or PowerShell
  • Delete folders using a VBA Macro or PowerShell

About Diane Poremsky

A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

Subscribe
Notify of
2 Comments
newest
oldest most voted
Inline Feedbacks
View all comments

Google (@guest_220486)
August 10, 2023 8:20 pm
#220486

Thnnnxxx.

0
0
Reply
Yorum (@guest_220451)
July 30, 2023 3:36 pm
#220451

Best best best..

0
0
Reply

Visit Slipstick Forums.
What's New at Slipstick.com

Latest EMO: Vol. 30 Issue 19

Subscribe to Exchange Messaging Outlook






Support Services

Do you need help setting up Outlook, moving your email to a new computer, migrating or configuring Office 365, or just need some one-on-one assistance?

Our Sponsors

CompanionLink
ReliefJet
  • Popular
  • Latest
  • Week Month All
  • Jetpack plugin with Stats module needs to be enabled.
  • Open Outlook Templates using PowerShell
  • Count and List Folders in Classic Outlook
  • Google Workspace and Outlook with POP Mail
  • Import EML Files into New Outlook
  • Opening PST files in New Outlook
  • New Outlook: Show To, CC, BCC in Replies
  • Insert Word Document into Email using VBA
  • Delete Empty Folders using PowerShell
  • Warn Before Deleting a Contact
  • Classic Outlook is NOT Going Away in 2026
Ajax spinner

Recent Bugs List

Microsoft keeps a running list of issues affecting recently released updates at Fixes or workarounds for recent issues in classic Outlook (Windows).

For new Outlook for Windows: Fixes or workarounds for recent issues in new Outlook for Windows .

Outlook for Mac Recent issues: Fixes or workarounds for recent issues in Outlook for Mac

Outlook.com Recent issues: Fixes or workarounds for recent issues on Outlook.com

Office Update History

Update history for supported Office versions is at Update history for Office

Outlook Suggestions and Feedback

Outlook Feedback covers Outlook as an email client, including Outlook Android, iOS, Mac, and Windows clients, as well as the browser extension (PWA) and Outlook on the web.

Outlook (new) Feedback. Use this for feedback and suggestions for Outlook (new).

Use Outlook.com Feedback for suggestions or feedback about Outlook.com accounts.

Other Microsoft 365 applications and services




New Outlook Articles

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

Google Workspace and Outlook with POP Mail

Import EML Files into New Outlook

Opening PST files in New Outlook

New Outlook: Show To, CC, BCC in Replies

Insert Word Document into Email using VBA

Delete Empty Folders using PowerShell

Warn Before Deleting a Contact

Classic Outlook is NOT Going Away in 2026

Newest Code Samples

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

Insert Word Document into Email using VBA

Warn Before Deleting a Contact

Use PowerShell to Delete Attachments

Remove RE:, FWD:, and Other Prefixes from Subject Line

Change the Mailing Address Using PowerShell

Categorize @Mentioned Messages

Send an Email When You Open Outlook

Delete Old Calendar Events using VBA

Repair PST

Convert an OST to PST

Repair damaged PST file

Repair large PST File

Remove password from PST

Merge Two Data Files

Sync & Share Outlook Data

  • Share Calendar & Contacts
  • Synchronize two computers
  • Sync Calendar and Contacts Using Outlook.com
  • Sync Outlook & Android Devices
  • Sync Google Calendar with Outlook
  • Access Folders in Other Users Mailboxes

Diane Poremsky [Outlook MVP]

Make a donation

Mail Tools

Sending and Retrieval Tools

Mass Mail Tools

Compose Tools

Duplicate Remover Tools

Mail Tools for Outlook

Online Services

Calendar Tools

Schedule Management

Calendar Printing Tools

Calendar Reminder Tools

Calendar Dates & Data

Time and Billing Tools

Meeting Productivity Tools

Duplicate Remover Tools

Productivity

Productivity Tools

Automatic Message Processing Tools

Special Function Automatic Processing Tools

Housekeeping and Message Management

Task Tools

Project and Business Management Tools

Choosing the Folder to Save a Sent Message In

Run Rules on messages after reading

Help & Suggestions

Submit Outlook Feature Requests

Slipstick Support Services

Buy Microsoft 365 Office Software and Services

Visit Slipstick Forums.

What's New at Slipstick.com

Home | Outlook User | Exchange Administrator | Office 365 | Outlook.com | Outlook Developer
Outlook for Mac | Common Problems | Utilities & Addins | Tutorials
Outlook & iCloud Issues | Outlook Apps
EMO Archives | About Slipstick | Slipstick Forums
Submit New or Updated Outlook and Exchange Server Utilities

Send comments using our Feedback page
Copyright © 2025 Slipstick Systems. All rights reserved.
Slipstick Systems is not affiliated with Microsoft Corporation.

wpDiscuz

Sign up for Exchange Messaging Outlook

Our weekly Outlook & Exchange newsletter (bi-weekly during the summer)






Please note: If you subscribed to Exchange Messaging Outlook before August 2019, please re-subscribe.

Never see this message again.

You are going to send email to

Move Comment