This is really old school, from back in the days of DOS and Win3.1, but it still works great with Outlook and Windows 7. Copy a code block to notepad and save using the file extension .bat. Double click to run it. You can add it to the Startup folder if desired.
If you prefer to use PowerShell, I have sample scripts at Use PowerShell to backup Outlook PST files.
Use this instead of the Backup utility provided by Microsoft (which does not work with 64-bit Outlook).
Note: If your path doesn't include spaces, you don't need to use double quotes.
For more information about the copy and xcopy commands and the switches you can use with them, see COPY, XCOPY, and MOVE Overwrite Functionality Changes in Windows (MSKB article)
Copy the pst file to a new location (overwrite existing file), when the copy is finished, start Outlook.
The /y switch overwrites the existing file, if it exists. Wait tells the batch to stop until the copy is finished before starting outlook.
copy /y "C:\path\to\original\datafile.pst" "C:\path\to\Backup\datafile.pst" :wait start outlook.exe
Copy the data file and give it a random name; when the copy is finished, start Outlook:
%random% replaces the file name with a random number to prevent files from being overwritten. Use the date stamp to identify the age of the files.
copy "C:\path\to\original\datafile.pst" "C:\path\to\Backup\"%random%.pst :wait start outlook.exe
Copy the pst file and rename it using today's date, start Outlook when the copy is complete.
This gets the date and breaks it down into year, month, day format, which we use in the filename of the copy. The batch waits for the copy to finish before starting Outlook.
for /f "tokens=1-5 delims=/ " %%d in ("%date%") do copy "C:\path\to\outlook.pst" "C:\path\to\Backup\"backup-%%g-%%e-%%f.pst :wait start outlook.exe
Copy all pst files in the folder, add the date to their file name. Start Outlook when the copy is finished.
This copies all of the pst files in the folder and like the previous batch file, this one adds the date to the filename of the copied pst files.
for /f "tokens=1-5 delims=/ " %%d in ("%date%") do copy "C:\Users\dianep\Documents\Outlook Files\"*.pst "C:\Users\dianep\Documents\Outlook Files\Backup\"*-%%g-%%e-%%f.pst :wait start outlook.exe
Copy other Outlook support files using a batch file
You can use a batch file to copy other files Outlook uses, including templates, signatures, and stationery. You can use the same methods used to copy the pst files, however, if you want to copy subfolders within a folder path, you'll need to use XCOPY instead of COPY.
Because the support files change less often, you can run this batch file weekly or after you make changes (such as editing your signature.)
To copy folders within a path, you'll need to use XCOPY and the /y and /e switches:
xcopy /y /e "C:\Users\username\AppData\Roaming\Microsoft\Templates\*.*" "C:\Backup\Templates\" xcopy /y /e "C:\Users\username\AppData\Roaming\Microsoft\Stationery\*.*" "C:\Backup\Stationery\" xcopy /y /e "C:\Users\username\AppData\Roaming\Microsoft\Signatures" "C:\Backup\Signatures"
More Information
For third party backup utilities, see the Tools lists on the following pages:
Outlook 2010 Backup and Dual-Boot File Locations
Outlook 2007 Backup and Dual-Boot File Locations
How to Backup your Outlook Account Settings
Looks fine. Tipp: Use %USERPROFILE% in the batch, so it is not dependant on fixed usernames.
Any way to adjust this script to hit a list of computers, and grab a 'username' variable to put into the backup file name?
I think so, but I don't have any code samples that do this. You may need wmic to get the user names then can pipe them into the batch.
General information pages on batch files:
https://support.microsoft.com/kb/240268
https://www.sevenforums.com/performance-maintenance/23820-batch-file-copy-made-easy.html
xcopy /y /e "C:\Users\username\AppData\Roaming\Microsoft\Templates\*.*" "C:\Backup\Templates\"
xcopy /y /e "C:\Users\username\AppData\Roaming\Microsoft\Stationery\*.*" "C:\Backup\Stationery\"
xcopy /y /e "C:\Users\username\AppData\Roaming\Microsoft\Signatures" "C:\Backup\Signatures"
Not tested but this should work, so you can use it with GPO for example:
xcopy /y /e "%appdata%\Microsoft\Templates\*.*" "C:\Backup\Templates\"
xcopy /y /e "%appdata%\Microsoft\Stationery\*.*" "C:\Backup\Stationery\"
xcopy /y /e "%appdata%\Microsoft\Signatures" "C:\Backup\Signatures"