# Batch to copy Outlook pst file to external drive



## prelude (Aug 23, 2013)

Hi,
I have a few questions about my simple batch to copy a Outlook pst file to an external drive. First, robocopy doesn't copy my file; Second, is there a way to prevent the taskeng.exe window from appearing; and Finally, I tried the command "copy" instead and it copies the file but the taskeng.exe window "hangs" and does not continue to restart outlook and therefore close on its own. By the way, the pst file is over 4Gb. Any help is appreciated, thank you!

:: Backup pst file to Server external drive
@echo off
setlocal EnableDelayedExpansion
start "" "C:\Program Files (x86)\Microsoft Office\Office12\Outlook.exe"
taskkill /im outlook.exe /f
@ping 192.168.1.1 -n 5 -w 1000>nul
@ping 192.168.1.1 -n 5 -w 1000>nul
robocopy "C:\Users.pst" "\\SERVER\Outlook Backup\user.pst"
start outlook.exe
cls
@exit


----------



## Keebellah (Mar 27, 2008)

Hi welcome to the form,
I imagine that by 'Taskeng.exe window" you mean the command promt, well if you use a shortcut link to it and ste the window to minimized, you won't see it but it'll be there.
For the copy to 'hang' I'm not sure but is Outlook closed? At leas, is task really killed?
Maybe you should add a line to check if the process is still running, this could cause the copy action to 'hang' and of course there'll be a visrus scanner that wants to 'take a look' at what's being copied too.


----------



## prelude (Aug 23, 2013)

Hi, Thanks for responding. About the 'taskeng.exe' window, it is a popup dos window that does not go away. I also do not know the codes to minimize or prevent the 'taskeng.exe' popup window from coming up. Concerning Outlook, the command 'taskkill' should have closed an open Outlook session. I also tried to manually close the outlook program and just copy the pst file but the batch still hangs. What I mean is that the taskeng.exe window remains open and the batch does not continue to the next line in the code which is to start a new session of outlook.


----------



## Keebellah (Mar 27, 2008)

Have you checked how large your pst file is?
These files can become quite big and since you're copying through the netwrok and these files contain mixed media it could be that it takes very long and looks like it hangs.
You will have to include errorlevl checks or use another method to copy the file.
Have you checked how long it takes if you copy it manually?
You could open a dos box and execute a copy fullpath source fullpath destination and clcok it?
BTW C:\Users.pst must be a sample this is not the way it's normally saved but it's your system


----------



## MikeFarmer (Sep 27, 2013)

Hi, Keebellah & prelude 

Prelude..
Can you tell which version of Outlook are you using??
May be it&#8217;s the case of large size of the PST file. File size increases with the increase in the email attachments that carry multiple data formats. Besides managing large-sized file is an issue. 

To perform PST Split, try following steps:

Open the MS Outlook program and select a PST file
Click File > Archive.
Archive dialog box will appear, click Archive this folder and subfolders.
Select a folder from the list shown in the dialog box.
In Archive items older than box, select a date.
Click Browse button, select a location and type a name for the new PST file.
Click OK

If you have problem in splitting the file I suggest you to use free demo version of SysInfoTools PST Split software.


----------

