Copy outlook.pst across LAN

  • Thread starter Thread starter Bob S
  • Start date Start date
B

Bob S

I am trying to copy my outlook.pst across my home LAN so that my wife can
have access to the contacts and for backup purposes. So, I created a simple
bat file to do it. Unfortunately, every time I run it, all I see is a blink
of the CMD window. I know there is a comand I can put into the bat file to
record the problem in a log file, but I am rusty. Could someone tell me
what that is?

If anyone has experience copying outlook.pst across a lan, please help on
that as well. BTW, I cannot even get outlook.pst to copy to another place
on my own HD, while I can copy other files across my LAN.
 
You will not be able to copy it while you have Outlook running.

You can download a utility from Microsoft to back up your .PST file at:
http://support.microsoft.com/default.aspx?scid=kb;en-us;238782

If you put a pause command at the end of your batch file, it will wait for you
to press a key before exiting, so you can see the output before it closes.

|I am trying to copy my outlook.pst across my home LAN so that my wife can
|have access to the contacts and for backup purposes. So, I created a simple
|bat file to do it. Unfortunately, every time I run it, all I see is a blink
|of the CMD window. I know there is a comand I can put into the bat file to
|record the problem in a log file, but I am rusty. Could someone tell me
|what that is?
|
|If anyone has experience copying outlook.pst across a lan, please help on
|that as well. BTW, I cannot even get outlook.pst to copy to another place
|on my own HD, while I can copy other files across my LAN.
|
|
 
Hello, Bob!
You wrote on Tue, 2 Nov 2004 17:51:28 -0600:

BS> I am trying to copy my outlook.pst across my home LAN so that my wife
BS> can have access to the contacts and for backup purposes. So, I created
BS> a simple bat file to do it. Unfortunately, every time I run it, all I
BS> see is a blink of the CMD window. I know there is a comand I can put
BS> into the bat file to record the problem in a log file, but I am rusty.
BS> Could someone tell me what that is?

so you have something like this:
copy file.pst \\lan\backups >> c:\OBLog.txt 2>&1

You can add that to every line of your file if you like.

BS> If anyone has experience copying outlook.pst across a lan, please help
BS> on that as well. BTW, I cannot even get outlook.pst to copy to another
BS> place on my own HD, while I can copy other files across my LAN.
BS>

Most likely you are trying to copy the file while Outlook is running. You
can't do that. Outlook has an exclusive lock on all its PST files while it
is running. Shutdown Outlook then run your batch file.

Regards, Paul R. Sadowski [MVP]. E-mail: (e-mail address removed)
 
Thank you very much. I have downloaded and installed the utility you
suggested and tried the pause statement. They were both very helpful.
Thanks again. Bob
 
Thanks Paul for the description of how to copy to the log file. I was
closing OL. But one of its processes (ThorConnWndClass) continued running -
thus keeping OL locked. I noticed this after posting this and trying to
restart WinXP Pro. ThorConnWndClass was still running at that time and I
had to end it in order to restart.
 
Hello, Bob:
On Fri, 5 Nov 2004 08:08:44 -0600: you wrote...

BS>
Thanks Paul for the description of how to copy to the log file. I was
closing OL. But one of its processes (ThorConnWndClass) continued running -
thus keeping OL locked. I noticed this after posting this and trying to
restart WinXP Pro. ThorConnWndClass was still running at that time and I
had to end it in order to restart.
BS>

Sounds like an add-in didn't shutdown or was taking a long time to shutdown.
I use this little VBScript to kill Outlook before doing an automated backup.

set wmi = getobject("winmgmts:")
wql = "select * from Win32_Process " & " where name='outlook.exe'"
set results = wmi.execquery(wql)
for each app in results
app.terminate
next

Regards, Paul R. Sadowski [MVP].
 
Hello Paul,

This script sounds very helpful. Could you take me one or two steps further
in terms of how to use this script? In other words, do I save this script
into a file (if so, how) and then run the file, or what? Thank you. I feel
like I am about to get helped and learn how to help myself all at the same
time. Thanks again. Bob
 
Hello, Bob:
On Fri, 5 Nov 2004 22:11:14 -0600: you wrote...

BS>
BS> This script sounds very helpful. Could you take me one or two steps
BS> further in terms of how to use this script? In other words, do I save
BS> this script into a file (if so, how) and then run the file, or what?
BS> Thank you. I feel like I am about to get helped and learn how to help
BS> myself all at the same time. Thanks again. Bob
BS>

Yes, save the text to a file called say, KillOutlook.vbs (The .VBS extension
is important). Then in your batch file you add a line like
cscript KillOutlook.vbs

That's all there is to using that.

Just hilight the text below then paste it into Notepad. Do a FILE | SAVE AS
and in the FILE TYPE dropdown box in the SAVE AS dialog, select ALL FILES.
Then save in the same directory as your batch file as KillOutlook.vbs

'Script starts here
set wmi = getobject("winmgmts:")
wql = "select * from Win32_Process " & " where name='outlook.exe'"
set results = wmi.execquery(wql)
for each app in results
app.terminate
next
'Script ends here

You said you are doing this on XP Pro?
If you want to stay with pure batch you could use this line in your batch
file instead of the VBS script (this for XP Pro only):
%WINDIR%\System32\taskkill.exe /F /IM OUTLOOK.EXE > nul 2>&1

This line will work in XP Pro and HE both
%WINDIR%\System32\tskill.exe outlook > nul 2>&1

Regards, Paul R. Sadowski [MVP].
 
Thank you so much Paul. That was very clear! I really appreciate the
script code and the explanation of how to save it and use it in a batch
program not only because it can solve this problem but because I have on
several occassions been told that certain problems can be solved with a
short script. This encourages me to learn a bit of VBS.

I also appreciate the batch code and may actually use it for this particular
issue. Since 2 of the computers on my home LAN are XP HE, I am tempted to
use the line for both XP Pro and XP HE. I noticed 3 differences.
1. The first one had OUTLOOK.EXE rather than outlook .
2. The first one had the switch /F
3. The first one had the switch /IM

Are there any things that are gained by the switches /F and /IM that I would
lose by going with the line that worked in both XP Pro and HE?
Also, do you know of any harm doing a taskkill on OL can cause to OL or
outlook.pst?

Thanks again.
Bob
 
Hello, Bob:
On Sat, 6 Nov 2004 11:46:56 -0600: you wrote...

BS>
BS> I also appreciate the batch code and may actually use it for this
BS> particular issue. Since 2 of the computers on my home LAN are XP HE, I
BS> am tempted to use the line for both XP Pro and XP HE. I noticed 3
BS> differences. 1. The first one had OUTLOOK.EXE rather than outlook .
BS> 2. The first one had the switch /F
BS> 3. The first one had the switch /IM
BS>
BS> Are there any things that are gained by the switches /F and /IM that I
BS> would lose by going with the line that worked in both XP Pro and HE?
BS> Also, do you know of any harm doing a taskkill on OL can cause to OL or
BS> outlook.pst?
BS>

I've been killing Outlook nightly for automated backup since 1998 with no
problems.

The different switches are related to the individual programs. TSKILL uses
the process name to find the process while TASKKILL can use an IMAGE NAME
(the /IM switch - the name of the executable). TASKKILL simply has more
options but it's not available on XP HE.

Either will work just as well for this purpose. VBScript and WSH are great
for automation and with it you can accomplish many things you can't
otherwise do so easily via the command line.

http://www.microsoft.com/scripting

Regards, Paul R. Sadowski [MVP].
 
Back
Top