Link to home
Start Free TrialLog in
Avatar of king daddy
king daddyFlag for United States of America

asked on

help with logon script setup and execution

Greetings,

I need to set a login script that runs locally on a 2008 R2 server running remote desktop services. It should import an Outlook 2007 PRF, then close outlook, then run the next command to install our doc management system add in for outlook 2007. I only need this to run once per user, at first login.

I wanted to run it locally, rather than in the domain login script, since it only needs to happen on the terminal server, not all domain computers.

I have the script and it does load the PRF. However, users are prompted to enter their username / initials, answer if they want online help, and then asked about updates, before being allowed to finish the outlook wizard. Even if this info is entered manually, which I want to avoid, it does not proceed with the next part of the script to add the doc mgt system add in. It doesn't close outlook automatically either.

I appreciate any help getting this to run. Script below, edited from what I got from FarrellFritz here:

https://www.experts-exchange.com/questions/27261784/VB-Script-To-Automate-Outlook-2010-Profile-Creation-Installation-Of-Add-In.html

____________________________________________________________________________________________
IF EXIST C:\Users\%username%\AppData\Roaming\Microsoft\Outlook\ GOTO SKIP_PRF

"C:\Program Files (x86)\Microsoft Office\Office12\Outlook.exe" /importprf C:\OutlookTerm.PRF

PING localhost -n 30 > NUL

TASKKILL /IM OUTLOOK.EXE /f

REM PING localhost -n 10 > NUL

"C:\Program Files\Interwoven\WorkSite\addiman.exe" Filesite

:SKIP_PRF

:EXIT

_____________________________________________________________________________________________

and this one just to add PRF

"C:\Program Files (x86)\Microsoft Office\Office12\Outlook.exe" /importprf C:\OutlookTerm.PRF
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of king daddy

ASKER

thanks for biting oBdA, I can really use the help. I will apply your edits to the script and test it out. I will also ask a new question regarding the wizard install of outlook 2007 and the subsequent prompts I would like to skip. I will post the link here so you can check it out, if you like.

thanks nappy_d. I will check out the GPO settings.
I just checked and the add-in is actually in the %ProgramFiles (x86)% folder. Also, the REM is a typo of sorts, I copied the incorrect file. Still, it's only the add-in path and REM that are different so your direction is still valid.

thanks again.
here is a link to the other question regarding skipping user prompts. thx

https://www.experts-exchange.com/questions/28130142/Skip-user-prompts-in-Outlook-2007-when-loading-PRF.html
so this worked for me, kinda. Still get the RSS pop-up but I can definitely live with that. Not sure why but when I put "%ProgramFiles%\Interwoven\WorkSite\addiman.exe" Filesite, it doesn't work. When I put what is below, it works.

thanks again for the help.

@echo off
if exist "%AppData%\Microsoft\Outlook" goto :eof
Reg Add HKCU\Software\Microsoft\Office\Common\UserInfo /v UserName /d "%username%"
Reg Add HKCU\Software\Microsoft\Office\Common\UserInfo /v UserInitials /d %username:~0,2%
Reg Add HKCU\Software\Microsoft\Office\12.0\Common\General /v ShownOptIn /t REG_DWORD /d 1 /f
start "" "%ProgramFiles(x86)%\Microsoft Office\Office12\Outlook.exe" /importprf C:\BRtermPRFv2.PRF
ping.exe localhost -n 60 >NUL
taskkill.exe /im OUTLOOK.EXE /f
ping.exe localhost -n 30 >NUL
"C:\Program Files (x86)\Interwoven\WorkSite\addiman.exe" Filesite
ping.exe localhost -n 15 >NUL
start "" "%ProgramFiles(x86)%\Microsoft Office\Office12\Outlook.exe"

Open in new window

Avatar of oBdA
oBdA

Since it's a 32bit application after all, you'll need "%ProgramFiles(x86)%" to access the Interwoven program folder.
Thanks for the points but I thought my answer was worth more as it directly answered your question. Hope it all works for you ;)
you are correct oBdA. It works now that I have edited it.

nappy_d - I am sorry you feel that way. While I do appreciate your help with this issue, you demonstrated how to set it in GPO to run per group, user, or machine. That addressed the one-sentence second paragraph. The major portion of my question had to do with the script itself not running past opening outlook and importing the PRF. So, while helpful in that I learned something, it was essentially useless until the script actually worked. The script now works, but I am running it locally. So your suggestion wasn't even put to use. The code I was given was most helpful in this situation, especially since I have very little experience with coding anything, hence the point distribution. I hope this doesn't prevent you from helping me in the future should I need it, and should you have relevant info.

Thanks to both of you.