Outlook 2003 : How to export a PST file with a script

A PC I use has the PST file hidden away on a server somewhere.

I'd like to be able to make regular backups using a script.

I know I can go
Menu --> "import and export" --> "Export to a file" --> Next --> "Personal Folder File ( .PST )" --> etc ... etc,
and that this works, however that takes far to long and i'm sure their must be API's in Outlook that can be hooked onto to do this such that the .pst file is exported to a chosen local C:\ drive location. Anyone have the script ?

Who is Participating?
WadskiConnect With a Mentor IT DirectorCommented:

Unfortunately unless you are a domain administator you will not be able to drive scripts etc over the network. Permissions are setup to prevent exactly what you are trying to do to ensure data integrity.

I'm sorry I cannot help any further as you are going to require network permissions which I doubt you will have.

Good luck with this!

WadskiIT DirectorCommented:

There is a Microsoft Add-In to backup your PST:


The problem of time will be due to the PST being on a server ad it having to transfer the file across the network to your PC.

kes3Author Commented:


The Microsoft Add-In to backup PST works just fine but requires mouse clicking intervention.

I need a non intervention script so I can roll the back-up in with other automated backup process.


Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

WadskiIT DirectorCommented:
Have a look at this guys blog on how he has done it:


He mentions he used Second Copy to perform the actual backup - you can use ntbackup to do the same thing.

He process is quite indepth becasue he closes Outlook whilst it runs.


You can just copy the the PST out from the server by using a batch file schedule task. But you need to close your Outlook First in order to allow the pst to be copy.

Create a simple batch file on your C: drive say eg backpst.bat

echo off
H:\                          <- example it is in your home drive in the server
Copy h:\*.pst C:\backup     <-- Copy the pst to a already created folder named backup

Launch your Scheduled Tasks from Control Panel
Run the wizard browse to your backpst.bat
It will prompt to be run by your login ID and password in order for the scheduler to work.
Set the frequency and do a test run to see if it work.

kes3Author Commented:

Hi Folks,

I don't know where the .pst file is stored such that I can make a copy of it.

It is not in the usual
H:\documents and settings\{username}\Local Settings\Application Data\Microsoft\Outlook\Outlook.pst

Is their a way I can find out using outlook where the .pst file is stored - I think it's somewhere on the network.


WadskiIT DirectorCommented:
In Outlook Click:


And it will show you your PSTs and datafiles. If this is blank you are most likely on Exchange and thus have no datafile as such.  (but no doubt you mail will be backed up centrally.
kes3Author Commented:

I think the files may well be kept on an Exchange server somewhere.

Remember this .pst backup will be incorporated into a script as part of a wider automated backup process so it has to be done by a script.

It thus seems that I need a script to drive the Outlook API's. Does anyone know how I can drive the windows / outlook interface with a script  such that i can create a backup of my .pst file ?
WadskiIT DirectorCommented:

If your emails are stored in an exchange mailbox it is not a PST file that you can backup.  The only way to be able to backup this data is to do as you initially did and export all the emails to a local PST Store.

Without understanding your company etc I would expect that your emails are backed up as part of a central backup routine by your IT department on a nightly basis.  These backups are able to be restored on an individual basis assuming your IT department have the skill level.

You require an automated Brick Level Backup of your mailbox.  This can be done with ExMerge (an Exchange Management tool) but unless you are a domain admin you will not be able to get anywhere near your mailbox, never mind automate the process.

This is a link to a website which details performing a brick level backup but it is intended for Mail Admins only: http://www.petri.co.il/brick_level_backup_of_mailboxes_by_using_exmerge.htm 
As for automating it, I would seriously suggest you don't as you could easily corrupt your mailbox whilst performing the backup anyway without having it happen during the server backup window.

kes3Author Commented:

Thanks Wadski for your insight : I'm not a mail admin and that is new to me.

However I am sure that much of windows can be driven with the windows shell, or vbs, or some ither scripting language.

Are their API's that can hook to Outlook to achieve this via a script.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.