Page 1 of 1 1
Topic Options
#21729 - 2002-05-15 08:18 PM KeyExist problem
jee Offline
Lurker

Registered: 2002-05-15
Posts: 2
I have created (at least tried to...) a script that automatically creates a new outlook profile for a user when he logs on. However I am having some troubles with this script. If I run this script manually on a PC or Server the script works fine, but if I run this script in the users logon script the script does not work. I think the problem is related to the line containing KeyExist. This line checks if a user has a profile for outlook. If I add the following line (messagebox("$ProfileStatus","Test") after that line to see what the value of the variable $ProfilStatus is I get KEYEXIST if I run this script from the logon script, but I get 0 (or 1) when I run the script manually. Other stuff like readvalue and writevalue works great both when I run them manually and through a logon script. Hope someone can help me.

if ingroup("L_App_Outlook") or ingroup("L_App_Office_Pro") or ingroup("L_App_Office_Std") or ingroup("L_App_Office")
$ProfilStatus=KeyExist("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\%username%")
if $ProfilStatus=0
copy "\\eeavir02\Clients\OfficeXPPro\outlook2002.prf" "h:\windows\outlook.prf"
shell "\\eeavir02\Clients\OfficeXPPro\prfpatch.exe"
sleep 2
shell "cmd /c start /max m:\program\micros~1\office10\outlook.exe /importprf h:\windows\outlook.prf"
endif
endif

Top
#21730 - 2002-05-15 08:30 PM Re: KeyExist problem
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See post http://81.17.37.55/board/ultimatebb.php?ubb=get_topic;f=10;t=000043. This explains when HKCU is available during login.
Also, search the BBS for numerous posts about Outlook profile generation.
_________________________
There are two types of vessels, submarines and targets.

Top
#21731 - 2002-05-15 08:38 PM Re: KeyExist problem
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
What OS is giving you the problem? It is a known issue that Win9x has a problem accessing HKCU in the logon script.

Does this problem manifest itself on NT/W2K? If not, try this code:
code:
	if @INWIN = 1
Call "Profile.kix"
else
$WinlogonKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Runonce"
$value = "%windir%\kix32.exe $Lpath\Profile.kix"
$rc = WRITEVALUE ($WinlogonKey, "Profile", $value, "REG_SZ")
endif



[ 15 May 2002, 22:08: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1172 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.058 seconds in which 0.032 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org