I made some schanges to my original script for better and easyer functionality.

quote:
;--- start of script ---
$windir=ExpandEvironmentVars('%windir%')
$profile=ExpandEnvironmentVars('%userprofile%')

copy '$windir\outlook.prf' '$profile'
;--- end of script ---

Outlook.prf is still copied to c:

All variables are resolved correctly. I tested this using by letting kix print the variables on
screen.

This is my script:
;**** Created with KiXscripts Editor | http://KiXscripts.com ****
;**** Last Modified on 27-03-2002 at 10:58:41 by ****

; ? "** Starting Automatic MS Outlook Profile Generation..."
? "** Checking if Outlook is installed..."
$i1 = Exist ("c:\program files\microsoft office\office10\outlook.exe")
If ($i1 = 1) Goto Check_Profile
? "** Outlook is NOT installed, skipping to end of script..."
Goto End

:Check_Profile
? "** Checking if outlook userprofile exists..."
$i2 = Exist ("%userprofile%\application data\microsoft\outlook\%username%.fav")

; Setting outlook profile import registry setting

;$rc = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\setup", "ImportPRF", "%userprofile%\outlook.prf", "REG_SZ")
If ($i2 = 0) Goto Copy_Profile
? "** Outlook profile found... skipping to end of script..."
Goto End

:Copy_Profile
? "** Copying Default Outlook Profile..."
Select
Case Ucase(@HOMESHR) = "\\NT1\USERS\%username%"
Shell "%COMSPEC% /E:1024 /C COPY " + @LDRIVE + "olp_rot.prf " + "%windir%\outlook.prf > NUL"
Case Ucase(@HOMESHR) = "\\AMSSVR01\USERS\%username%"
Shell "%COMSPEC% /E:1024 /C COPY " + @LDRIVE + "olp_ams.prf " + "%windir%\outlook.prf > NUL"
EndSelect
? "** Creating new Outlook profile based on current user..."
Shell "%COMSPEC% /E:1024 /C " + @LDRIVE + "prfpatch.exe"
IF @HOMESHR = \\NT1\USERS
Shell "%COMSPEC% /E:1024 /C COPY " + "%windir%\outlook.prf" "\\nt1\users\%username%\outlook.prf"
ENDIF
IF @HOMESHR = \\AMSSVR01\USERS
Shell "%COMSPEC% /E:1024 /C COPY " + "%windir%\outlook.prf" "\\AMSSVR01\users\%username%\outlook.prf"
ENDIF
$rc = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\setup", "ImportPRF", "%HOMESHARE%\outlook.prf", "REG_SZ")
:End

This is what i see when i run it:

** Checking if Outlook is installed...
** Checking if outlook userprofile exists...
** Copying Default Outlook Profile...
** Creating new Outlook profile based on current user... 1 file(s) copied.
\\nt1\users\Administrator\outlook.prf

When i add a line to copy c:\outlook.prf to the userdir it says that kix can't copy a file to itself. [Confused] [Mad]
All script seems to bee ok but the users userdir i resolved as c: by kix. When i let kix display the @HOMESHR variabel it shows \\server\users adding the suername shows \\server\users\username.
Copying a file to this location will result in the file beeing copied to c: [Confused] [Mad]

[ 27 March 2002, 18:49: Message edited by: R2D2 ]
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.