SetConsole('SHOW')
;
; Declaring Global Variables
;
DIM $Selection ;Used to determine the button pressed by the user.
DIM $FILE1 ; OutlookRan.txt check file
DIM $PATH1 ; Path to Outlook folder on psroot
DIM $DEFAULTS ; script that inserts default outlook profile settings
DIM $REGEXPORTS ; script for registry exports
DIM $DELETE ; script for deleteing data we don't need
;
$Rc = SetOption('NoVarsInStrings', 'On')
$Rc = SetOption('NoMacrosInStrings', 'On')
;
; Specify File and Path Variables
;
$FILE1 = 'c:\Scripts\OutlookRan.txt'
$PATH1 = '\\netshare\userconfigs$\' + @userid + '\PSCitrixConfig\Outlook'
;
; Specify additional script variables
;
$DEFAULTS = 'c:\scripts\apphelpscripts\defaults.cmd'
$REGEXPORTS = 'c:\scripts\apphelpscripts\regexports.cmd'
$DELETE = 'c:\scripts\apphelpscripts\delete.cmd'
;
; Provide the user a popup message asking them if they want to proceed with this script or to exit.
;
$Selection = MessageBox ("This will rebuild your Outlook profile, Do you wish to continue? Press YES to rebuild your outlook profile, or press NO to cancel", " Rebuild Outlook profile on Launchpad servers", 36)
If $Selection = 6
; Now we're going to start deleteing data
MessageBox ("Once you click OK on this message the Outlook reset process will start. Please wait until you see another message informing you the rebuild has completed before using any office applications..", " Outlook profile rebuild on PS Launchpad servers started.....", 0, 10)
SHELL '%comspec% /c taskkill.exe /IM "outlook.exe" /F /T'
SHELL '%comspec% /c taskkill.exe /IM "ObClnt32.exe" /F /T'
SHELL '%comspec% /c taskkill.exe /IM "obunity.exe" /F /T'
Sleep 5
RUN $DELETE
Sleep 5 ; script paused for 5 seconds, after the pause we re-add default data, and launch Outlook
Run $DEFAULTS
SLEEP 13 ; Pausing to let outlook sort out it's profile, next we kill Outlook.
SHELL '%comspec% /c taskkill.exe /IM "outlook.exe" /F /T'
SHELL '%comspec% /c taskkill.exe /IM "ObClnt32.exe" /F /T'
SHELL '%comspec% /c taskkill.exe /IM "obunity.exe" /F /T'
SLEEP 5 ; Pause a moment to let Outlook close and clean up, then we copy our correct outlook profile settings out to our network share for safe keeping
COPY $FILE1 $PATH1
RUN $REGEXPORTS
SLEEP 5 ; Last pause before our final message box.
MessageBox ("Your Outlook profile has been Rebuilt, and your e-mail should now work properly. If you continue to have problems with using Outlook, please open a Helpdesk or contact extention 2500.", " Outlook Profile Rebuild Completed!", 0, 10)
ELSE
EXIT
ENDIF
EXIT