Page 1 of 1 1
Topic Options
#38143 - 2003-03-21 12:00 AM Changing Registry Key for Office
hobbes Offline
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 Offline
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 Offline
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
#38146 - 2003-03-21 03:39 AM Re: Changing Registry Key for Office
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Is the regentry in UNICODE? Then each HEX of each letter would be preceeded by a 00. Just convert each letter into it's ASCII code with ASC, then convert to hexadecimal with DEC2HEX(). It's all in the KiXtart Manual.
_________________________
There are two types of vessels, submarines and targets.

Top
#38147 - 2003-03-21 08:11 AM Re: Changing Registry Key for Office
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Did you understand that Hobbes?

If you're new to Kixtart I bet you didn't.

Please post again if you need further help with this.

[ 21. March 2003, 08:11: Message edited by: NTDOC ]

Top
#38148 - 2003-03-24 08:46 PM Re: Changing Registry Key for Office
hobbes Offline
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 Offline
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.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

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 1047 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.066 seconds in which 0.034 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