Page 1 of 1 1
Topic Options
#24638 - 2002-07-09 09:16 PM Script to copy .PST file
rmaxfli Offline
Lurker

Registered: 2002-07-09
Posts: 1
I am brand new to this. Does someone know how to create a Windows 2000 script to copy the Outllok.pst file from local workstation to Server..thanks
Top
#24639 - 2002-07-09 09:38 PM Re: Script to copy .PST file
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Welcome to the board.

We were interesting in your problem and we have create a script
which will search for a existing PST files on your clients.
It can be necessary that you are changing the destination file-
name.

Our code is:
code:
 $search_key="c:\*.pst"
$server="x:\outlook" ; <== destination directory on your server.
; ; <== it can be also something like "\\server\share"
;
IF (Exist("%temp%\kixtart.tmp") = 1)
DEL %temp%\kixtart.tmp
ENDIF
SHELL "%comspec% /e:1024 /c dir "+$search_key+" /a /b /s >%temp%\kixtart.tmp"
SHELL "%comspec% /e:1024 /c echo -end.of.list- >>%temp%\kixtart.tmp"
IF (Exist ("%temp%\kixtart.tmp") = 1)
IF Open(1,"%temp%\kixtart.tmp")
ENDIF
$found="no"
$count=0
WHILE ($found = "no")
$result=ReadLine(1)
IF (@error <> 0) OR (InStr($result,"-end.of.list-") <> 0)
$found="yes"
ELSE
$count=$count+1
? Substr("$count"+" ",1,4)+" "+$result+" ("+GetFileSize($result)+" bytes "+GetFileTime($result)+")"
IF Open(2, $result)
ENDIF
; - your actions on this file
GOSUB additional_actions
IF Close(2)
ENDIF
ENDIF
LOOP
IF Close(1)
ENDIF
IF ($count <> 0)
? "Informative KIX: "+$count+" files found with key '"+$search_key+"'."
ELSE
? "Warning KIX: no files found with key '"+$search_key+"'."
ENDIF
ENDIF
DEL %temp%\kixtart.tmp
EXIT
:additional_actions
IF (Substr($server,Len($server),1) = "\")
$server=Substr($server,1,Len($server)-1)
ENDIF
IF ($count > 1)
$destination=$server+"\"+@userid+"_"+$count+".pst"
ELSE
$destination=$server+"\"+@userid+".pst"
ENDIF
? "Info: copy '"+Lcase($result)+"' ("+GetFileSize($result)+" bytes)"
COPY $result $destination /h
IF (@error <> 0)
? "Warning: error @error (@serror)"
ENDIF
RETURN

For other ideas see our script outlook.kix on our site.
Greetings.

[ 09 July 2002, 21:53: Message edited by: MCA ]
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#24640 - 2002-07-09 09:40 PM Re: Script to copy .PST file
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
MCA,

One comment.. If this is to be done at the time of login, shouldn't there be a check to see if Outlook.exe is open? On the same thread, shouldn't there be an option to re-link the PST?

Regards,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#24641 - 2002-07-09 09:53 PM Re: Script to copy .PST file
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Indeed Kent, only we must wait for additional information from rmaxfli.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#24642 - 2002-07-10 03:49 PM Re: Script to copy .PST file
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
The way I read his question is that he wants to back up the local *.PST files to a server, not change the location of the .PST file for Outlook.
_________________________
There are two types of vessels, submarines and targets.

Top
#24643 - 2002-07-10 03:57 PM Re: Script to copy .PST file
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

We read it in the same way. Some improvements are:
- how to handle when outlook is open
- get actual outlook PST location by registry
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#24644 - 2002-07-10 05:50 PM Re: Script to copy .PST file
ITDEPT Offline
Fresh Scripter

Registered: 2002-06-11
Posts: 26
Loc: Edmonton, Alberta, Canada
you don't need to get that complicated just to copy a .pst file. There is a freeware program on nonags called RoboCopy. Download it and put it on the server somewhere. Have the script copy it to the c: drive of the local machine (the program is small, wont take more than a second), then have the script run it and copy the file to the home share.

script....

md h:\DOCUMENT_BACKUP
COPY \\server\robocopy.exe c:\
run "c:\robocopy.exe c:\ h:\DOCUMENT_BACKUP *.pst /s"

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 515 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.059 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org