batch file to sync outlook.pst

C

cronish

Unable to copoy outlook.pst from desktop to laptop over home network. Batch
file doesn't work, and in command line, error message is "The system cannot
find the file specified." The outlook.pst file is not hidden or read-only,
and I can copy it over the network using drag & drop, but for some reason
cannot get it to run from a .bat or .cmd file.
 
S

Shenan Stanley

cronish said:
Unable to copoy outlook.pst from desktop to laptop over home network.
Batch file doesn't work, and in command line, error message is "The system
cannot find the file specified." The outlook.pst file is not hidden or
read-only, and I can copy it over the network using drag & drop, but for
some reason cannot get it to run from a .bat or .cmd file.

Hope that email is.. faked.

Yeah - you would have to give more information.

For example..
- Is Outlook open or closed when you are trying to copy it?
- What is the contents of your batch script?
- If it is a scheduled task - what rights does the task have?
- When you run the batch script from the command prompt manually - what
errors do you get?
 
C

cronish

I guess that was pretty lame, I'm completely new to batch files, took an
online tutorial this morning and a little knowledge is a dangerous thing, I
guess. Anyway, the scripts I tried were all like this:

@echo off
Copy C:\Documents and Settings\G.D. Peters\Local Settings\Application
Data\Microsoft\Outlook\outlook.pst L:

where L: is a "Map Network Drive" location opened directly to the Outlook
folder on the laptop I'm trying to sync with.

I tried both with a batch file and directly with the command line. With the
batch file there is no error message, just no result. With the command line
the error message is always "The system cannot find the file specified."

Outlook is closed on both boxes when I'm doing this, or else I realize the
..pst file would be inaccessible.

I even tried copying from the Outlook folder to another folder I created on
my C: drive with this script...

copy C:\Documents and Settings\G.D. Peters\Local Settings\Application
Data\Microsoft\Outlook\outlook.pst c:\testbackup\outlook.pst

....both with a batch script and with the command line, and got the same
result, "The system cannot find the file specified."
 
B

billious

Shenan Stanley said:
Hope that email is.. faked.

Yeah - you would have to give more information.

For example..
- Is Outlook open or closed when you are trying to copy it?
- What is the contents of your batch script?
- If it is a scheduled task - what rights does the task have?
- When you run the batch script from the command prompt manually - what
errors do you get?


cronish said:
I guess that was pretty lame, I'm completely new to batch files, took an
online tutorial this morning and a little knowledge is a dangerous thing, I
guess. Anyway, the scripts I tried were all like this:

@echo off
Copy C:\Documents and Settings\G.D. Peters\Local Settings\Application
Data\Microsoft\Outlook\outlook.pst L:

where L: is a "Map Network Drive" location opened directly to the Outlook
folder on the laptop I'm trying to sync with.

I tried both with a batch file and directly with the command line. With
the batch file there is no error message, just no result. With the command
line the error message is always "The system cannot find the file
specified."

Outlook is closed on both boxes when I'm doing this, or else I realize the
.pst file would be inaccessible.

I even tried copying from the Outlook folder to another folder I created
on my C: drive with this script...

copy C:\Documents and Settings\G.D. Peters\Local Settings\Application
Data\Microsoft\Outlook\outlook.pst c:\testbackup\outlook.pst

...both with a batch script and with the command line, and got the same
result, "The system cannot find the file specified."


Where you have spaces (and some other symbols) in a file or pathname, you
need to enclose the name in double-quotes, otherwise the parser simply
interprets the space as an argument-separator and attempts to locate (in
your case) C:\Documents and Settings\G.D. and copy that to Peters\Local

Try

Copy "C:\Documents and Settings\G.D. Peters\Local Settings\Application
Data\Microsoft\Outlook\outlook.pst" L:

(this is all one line, and will likely be wrapped by your newsreader)

Note that this will copy the file to the current directory on L:, not
L:\Documents......

For batch methods discussion for NT/2K/XP, try alt.msdos.batch.nt

HTH

....Bill
 
C

cronish

Thank-you, Bill, that was great. It didn't work from a batch file, but it
DID work from the command prompt. Is there any reason the same thing
wouldn't work with a batch file? If not, I'm guessing there is a way to
create a .cmd file that I can store somewhere and run from the command line,
rather than having to type out the entire script every time. Still, I'm on
the right trail, now, thanks so much, and happy holidays.
g.

 
C

cronish

I'm not finding any resources for writing cmd scripts. Am I wrong in
guessing I could write a script and call it something.cmd and run it from
the command line, to make that copy without typing the whole script every
time?
 
C

cronish

Okay, I figured it out, thanks for your help, it got me on the right trail.
There was an extra space between "Application" and "Data" that I couldn't
see because of the window wrap. Once I removed it and saved as a .bat file
to the desktop and also as a .cmd file to Windows\System32, both scripts ran
perfectly. Thanks again for your kind replies, much appreciated.
g.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top