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
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?
Introduction In a recent article published by InformationWeek, [...]
After seven years of running both Windows and [...]
Wasabi Backup Sofware for MSPs, Resellers, and [...]
See What Our Partners Are Saying About Us

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!

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

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.

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.

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








