|
Here is the rest except for the statements containing the Newprof.exe file, which creates the profile. Like you said there doesn't look like there is a syntax error and it didn't beep upon completion, but it still didn't write anything on the outlook.prf file.
;*********************************************** ; Determine correct Windows OS and assign Outlook ; profile location and windows directory location ; in the Registry accordingly. ;***********************************************
IF @inwin=1 $profilelocation=$userwinkey+' NT\CurrentVersion\Windows Messaging Subsystem\Profiles' $windir=READVALUE($machinewinkey+' NT\CurrentVersion','SystemRoot') ENDIF
IF EXIST("C:\scripts\outlook.prf") DEL "C:\scripts\outlook.prf" -s ENDIF
;Some initial settings ;*************************** $profile_remove='Yes' ; Remove All other Outlook profiles under current user $deleteitems='No' ; Empty Outlooks Deleted Items Folder on Exit $explorview='Yes' ; Outlook Explorer View 'Yes' or Standard View 'No' $editorpref='10001' ; Editor Preference 10001=Plain Text, 20001=HTML, and 30001=Rich Text $company='Chestnut Health Systems' $serverloc=@lserver+'\Netlogon\Profgen\Outlook2000' ; Outlook Executables/files location $exchangeserver='E2k0301' ; Main Exchange Server Location $systemdrive=SUBSTR($windir,1,3) $scriptdir=$systemdrive+'\Scripts' $prf=@lserver+'\netlogon\sr-kixscripts\outlook.prf' $prffile=$scriptdir+'\'+$prf $ppru=$profilelocation+'\'+@userid $mses=$profilelocation+'\MS Exchange Settings'
;***************************************************** ; cHECKING FOR THE EXISTENCE OF A PROFILE, AND IF SO ; END THE SCRIPT, IF NOT CREATE ONE. ; ;*****************************************************
$ReturnCode = KEYEXIST($ppru)=1 OR KEYEXIST($mses)=1 IF $ReturnCode RETURN ELSE $exe=ReadValue($machinewinkey+'\CurrentVersion\App Paths\OUTLOOK.EXE','') $ver=GetFileVersion($exe) $pos_locat=INSTR($ver, '.') -1 $verchk=SUBSTR($ver,1,$pos_locat) IF EXIST($scriptdir)=0 MD $scriptdir ENDIF
COPY $prf $scriptdir
;************************************************** ; ; Assign an Exchange Server and profile information ; to the .prf file ; ;**************************************************
SELECT CASE IF $exchangeserver<>ReadProfileString($prffile,'Service2','HomeServer') WriteProfileString($prffile,'Service2','HomeServer',$exchangeserver) CASE IF @USERID<>READPROFILESTRING($prffile,'General','ProfileName') WriteProfileString($prffile,'General','ProfileName','@USERID') CASE IF @USERID<>READPROFILESTRING($prffile,'Service2','MailboxName') WriteProfileString($prffile,'Service2','MailboxName','@USERID') ENDSELECT
IF $profile_remove='YES' $index=0 $keyname=ENUMKEY($profilelocation,$index) WHILE @error=0 IF $keyname<>@userid $rc=DELTREE($profilelocation+'\'+$keyname) ENDIF $index=$index+1 $keyname=ENUMKEY($profilelocation,$index) LOOP ENDIF
|