#38143 - 2003-03-21 12:00 AM
Changing Registry Key for Office
|
hobbes
Lurker
Registered: 2003-03-20
Posts: 3
|
I'm trying to use Kixtart to change the UserInformation registry key for MSoffice. The workstations are NT 4.0 running office 97. The problem with the change is that it is a "Reg_Binary" entry with a Hex value. And when using the @userid (or @wuserid) to get the user name to change the value it's not in the needed hex format. Is there a way to obtain the hex value of the user ID so I can use it to make the registry edit? Here is the registry entry that I'm trying to change: code:
WriteValue("HKCU\Software\Microsoft\Office\8.0\Common\UserInfo", "UserInitials", "@USERID", "REG_BINARY")
|
|
Top
|
|
|
|
#38144 - 2003-03-21 12:26 AM
Re: Changing Registry Key for Office
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
Hello Hobbes,
Welcome to the KiXtart board.
I don't think you can do it with that version of Office. Please take a look at the following article for further information.
http://www.winguides.com/registry/display.php/460/
|
|
Top
|
|
|
|
#38145 - 2003-03-21 03:31 AM
Re: Changing Registry Key for Office
|
hobbes
Lurker
Registered: 2003-03-20
Posts: 3
|
NTDOC, Thanks for the response, but I think I should have been a bit more specific. I'm not trying to change the owner information for the software, just the current user info. The key I'm trying to change can be done manually by (in word 97) clicking on Tools, Options, User Info tab. This way we know who's worked on or is working on a specific document.
|
|
Top
|
|
|
|
#38148 - 2003-03-24 08:46 PM
Re: Changing Registry Key for Office
|
hobbes
Lurker
Registered: 2003-03-20
Posts: 3
|
Yes, I am relatively new to kix and a little more help would be very useful, thanks.
|
|
Top
|
|
|
|
#38149 - 2003-03-25 02:34 AM
Re: Changing Registry Key for Office
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,
Our code for upgrading that specific key
code:
$fullname=@userid" ; $ikey="HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Common\UserInfo" IF (ExistKey($ikey) = 0) ; $i=1 $username1="" WHILE ($i <= len($fullname)) $hex=dectohex(asc(substr($fullname,$i,1))) $username1=" "+$username1+$hex+"00" $i=$i+1 LOOP $username1=LCASE(LTRIM($username1)+"00"+"00") $result=WriteValue($ikey, "UserName", $username1, "REG_BINARY") IF ($result = 0) ? " "+$ikey+"[UserName]='"+$username1+"'+'"+$fullname+"'" ELSE ? " error "+$ikey+"[UserName]='"+$username1+"'+'"+$fullname+"' -> "+$result ENDIF ENDIF
greetings.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 1047 anonymous users online.
|
|
|