In this tutorial, we’ll guide you through the process of safely closing Outlook from the command line

This method is particularly useful when backing up PST files, especially if you encounter errors stemming from locked system files.

Safe Outlook Backup: Closing Techniques & Scripts

The Importance of Safely Closing Outlook

Discover why it’s crucial to close Outlook properly for error-free PST file backups.

Step 1: Setting Up Your Visual Basic Script

Create a script outlookcloser.vbs with the following code to close Outlook:

On Error Resume Next
Set Outlook = GetObject(, "Outlook.Application")
If Err = 0 Then
Outlook.Quit()
Set Outlook = Nothing
End If
Wscript.Quit

Step 2: Writing a Batch File for Closure and Backup

Develop StopOutlookBatch.bat using the script above to close Outlook and initiate backup:

@echo off
REM Close Outlook gracefully
cscript.exe outlookcloser.vbs //B //nologo
choice /T 10 /D y > nul
REM Backup Outlook PST
robocopy.exe C:\Users\USER\AppData\Local\Microsoft\Outlook\ C:\outback\ outlook.pst

Step 3: Running Your Batch File for Backup

Execute the batch file to close Outlook and safely back up the PST file.

Alternative Methods for Closing Outlook

Manual Closure

Simply close Outlook manually before initiating the backup. This method is straightforward but requires manual effort.

Task Scheduler

Set up the Windows Task Scheduler to automatically close Outlook at a predetermined time, ideally just before the backup starts.

Third-party Software

Use specialized software designed to manage application closure before backup, offering automated and flexible solutions.

PowerShell Script

Alternatively, a PowerShell script can be written to close Outlook. This method is more suitable for users comfortable with PowerShell scripting.

Group Policy for Enterprises

In an enterprise setting, Group Policy can be employed to manage application usage, including closing Outlook in sync with backup schedules.

Special Instructions for WholesaleBackup Software Users

WholesaleBackup users can rely on the software’s VSS feature for backing up Outlook, making these scripts unnecessary.

Securing Your Outlook Data

These methods ensure the safe and efficient backup of Outlook data, catering to different user needs and environments.

Note for WholesaleBackup Users: If you’re utilizing our software, you DO NOT NEED this script. Our software proficiently leverages VSS to backup Outlook files, ensuring reliability where many top-tier backup applications falter, particularly with Outlook PST files. However, if you’re attempting a DIY solution or referencing suggestions from forums like Spiceworks, this guide can be handy.

WholesaleBackup Provides a White Label Backup Software Platform, That Allows You To Offer Secure, Automated Offsite Backup Service

white box of bundled software

WholesaleBackup provides a full suite of white label backup software

You can build your very own Windows backup server using our server backup platform and then provision end-user online backup clients branded with your company name. Your customers will have a local and online backup system where they can store their backup data in a local vault on their own machine in addition to having another backup storage vault on your Windows backup server.

We also provide a hybrid cloud backup platform that allows you to store customer data on very cheap cloud storage from Amazon S3, Wasabi, Backblaze B2, and Google cloud storage. This option does not require you to have your own server. All you have to do is provision the cloud backup clients with your company brand and logo, once they are installed and the selections are made for the files and folders to backup, the data will go through a de-duplication process to avoid duplicate files, then create file blocks which are encrypted for transmission which will be sent to your cloud storage vault.

Whether you choose to build your own backup server or create your own cloud backup clients, you can run and monitor your backup business from a web browser with the Backup Management Web Console, which centralizes all of your customer’s status, backups, settings, and billings information. Our Partners, MSPs, VARs, and resellers, call this the mission control center for their backup operations.

Want to Start an Online Backup Business?

🔒 See the Full How-To Guide for Online Backup Success

Need the Complete Technical Deep Dive?

Download the Backup Ops Web Console Platform Overview

Access the full 8-page document detailing:

  • Business Model Advantages, including zero infrastructure investment and month-to-month flexibility.
  • Technical Specifications, Client Compatibility, Data storage and recovery management.
  • Step-by-Step Rapid Deployment and Ongoing USA-Based Technical Support.

How Can We Help?

The team at WholesaleBackup is happy to listen and share their backup & recovery expertise spanning over 20 years of business-class backup software solutions for resellers, MSPs, and IT Pros. If you are ready to begin building a more profitable and reliable backup service you’re in the right place.

  • Learn how to get started with labeling & deploying your own backup service
  • See how to schedule, run backups, and restore data
  • Understand how to remotely manage and monitor end-user’s backups
  • Get any questions you have addressed

Take a minute to fill out the form and we’ll follow up with you about your request. For a quicker response start a conversation in the chat.

Label & Launch Your Backup Software in 5 Mins

Start your all-inclusive, no-risk, free trial today

REGISTER

See What Our Partners Are Saying About Us

vanguard bulldog technologies

We were able to quickly restore our clients data without any issues using their last good backup – saving them from total data loss and stopping their business!

Joe Massa - IT Administrator, BullDog Technologies (Vanguard Systems)
digitalninjaz - partner

Your response time to any and all my request is far superior to any customer service I’ve ever received my ENTIRE CAREER.

Bao Tran, Digital NinjaZ (Founder)
cloud9 wholesalebackup partner

I am very impressed with the level of customer care and communication you have put forth into making sure that our setup with you guys goes smoothly.  It is rare nowadays to find vendors that take pride in their products as well as show concern for a client’s well-being.

Glen Rostant, President Cloud 9 Solutions, Inc.
Managed IT Solutions (for Dentists)

After using another white-label cloud backup solution for years, switching to WholesaleBackup has been a lifesaver. MUCH less maintenance, cost, bandwidth, and the U.S. based support is the stellar.  The software and interface is SO much simpler and easy to use.   I would recommend WholesaleBackup to any MSP looking to streamline their cloud backup system.

Beau Odom - COO, PCSI Managed IT Solutions
Manage Pointe Technologies

After trying multiple name brand backup vendors, we finally Partnered with WholesaleBackup and couldn’t be happier with the functionality and cost.

Michael Vaughan - Infrastructure Architect, ManagePointe Technologies, Inc

Get Started Now

Simply Pick a Backup Platform Storage Option

You’ll only pay the raw cost of the data used on the cloud storage platform directly.
We never mark up cloud storage backup costs so you can maximize revenue when pricing your online backup service.

AWS S3

S3 storage option for WholesaleBackup

Wasabi

Wasabi cloud storage option for WholesaleBackup

Backblaze B2

Backblaze cloud storage option for WholesaleBackup

Google Storage

GCS (Google) cloud storage option for WholesaleBackup

Synology C2

Synology cloud storage option for WholesaleBackup

Self-Hosted Windows Server

Self-hosted Windows Server storage option for WholesaleBackup

macOS Platform

Run WholesaleBackup software on the macOS platform