
If you’re an Outlook user, you may not know, but all of your email messages, contacts, calendar appointments, etc are stored in a .PST file. PST stands for “Personal Folder File”, and can be quite handy when you want to consolidate everything for backups.
But how do you back THIS file up?
Sure, you can do it through the import/export wizard in Outlook, but the whole point in being productive is to automate the menial tasks. So I’m going to show you how to do it.
To begin with, you’ll need to download the Windows 2003 Resource Tools, since we’ll be using robocopy. Also, you’ll need to check and see if your system has Taskkill, and if not, download it. To check, go to the command prompt (Click “Start->Run”, type “cmd”, and at the prompt type “taskkill”. If you DONT get a line saying it cant be found, then you have it. If you dont have it, get it from the above link and drop it in to your windows\system32 directory).
Ok, now that you have the tools, bust out Notepad, and cut and paste the following into it, saving it with a .bat extension.
@echo off
taskkill /f /im OUTLOOK.EXE
robocopy “X:\Documents and Settings\user\Local Settings\Application Data\Microsoft\Outlook” “X:\Backup” *.* /S /PURGE /NP /XO
“C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE”
You’ll need to change the “X:” to correspond with your setup, as well as the backup destination. Also, double check to make sure your path to “Outlook.exe” is right. If not, just change it here.
So what does this script do? Well:
taskkill /f /im outlook.exe closes any instances of Outlook running. If it’s open when you try and run this, you’ll get an error.
The “robocopy” line copies the .pst file to the backup location
The third line restarts Outlook. If you dont want it to reload once the backup is done, omit this line
Save the file with a .bat extension, add it to your scheduled tasks, and you’re done!
robocopy, outlook, backup, pst, email backup, email storage, scripting, windows backup, microsoft office backup, outlook backup