Hello.

I have looked around, trying to improve my auto-configuration for a new roaming profile in our Citrix-environment.

The auto-generation of the primary account to our exchange-server works perfect.

However: a few users need to set up an additional mailbox (or two).

I have "snapped" some code from one of the forums, and moderated it into norwegian, putting in some check in my primary script so that the right users run this script.

The script for this code is called by the call-command in kix.

 Code:
Break on 

$hklms = 'HKEY_LOCAL_MACHINE\Software'
$exe=ReadValue($hklms+"\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE","")
Shell($exe) ; -- Start Outlook
 Sleep 5


SetFocus ("Microsoft Outlook")
$=SendKeys("~e")
Sleep 1
$=SendKeys("e")
Sleep 1
$=SendKeys ("~V")
$=SendKeys ("n")
$=SendKeys("~E")
$=SendKeys("~F")
$=SendKeys("+{TAB}{RIGHT}")
$=SendKeys("~L")
$=SendKeys("SomeAccount1{ENTER}")
$=SendKeys("~L")
$=SendKeys("SomeAccount2{ENTER}")
$=SendKeys("~B")
$=SendKeys("{ENTER}")
$=SendKeys("n")
$=SendKeys("{ENTER}")



When Outlook already is open, this works perfectly, allthough it opens another window with outlook. This I can live with. But when I'm trying with my logon-script, it just freezes, nothing happens, exept outlook opens, and then the scripts doesn't work any more.

Have tried different ways to solve this, but not getting any further. Can somebody show me the light?

Regards /J
_________________________
I was placed on earth to do a job. Right now I have so much to do, I will never die..