View Single Post
  #1  
Old 23-02-2010, 04:47 PM
DAN682's Avatar
DAN682 DAN682 is offline
Sign me up!
Nazi Sled Driver
 
Join Date: Jul 2005
Location: Mandurah
Posts: 2,364
Thanks: 25
Thanked 13 Times in 9 Posts
DAN682 at standard level
Send a message via ICQ to DAN682 Send a message via MSN to DAN682 Send a message via Yahoo to DAN682
Default Nerds Unite! Need help converting a string to Binary

We have just put a new Document management system in and to automate the registering process, I have to push a change out to all users machines so that their Active Directory Display Name is pumped into Office (2003) (Tools --> Options --> User Information Tab under the Name: Field

Anyway, Off to google for help. ner nerrrr

Off to Experts-exchange for help, new question...

Got a reply, run this code:

Dim Path , o, ws
Dim objADsUser, objADSystemInfo, objDisplayName
err.Number = 0
Set objADSystemInfo = CreateObject("ADSystemInfo")
Set objADsUser = GetObject("LDAP://" & objADSystemInfo.UserName)
objDisplayName = objADsUser.DisplayName
Path = "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\ Common\UserInfo\"
set ws = WScript.CreateObject("WScript.Shell")
o = ws.RegWrite(Path & "UserName", objDisplayName, "REG_SZ")
Set WSHShell = nothing

Easy! However, it pumps the username in as a string (REG_SZ), I need it to convert he display name from ASCII to Binary.

Any nerd know how to do this?

I know, this is not www.perth-nerds.com but there was a problem loading page

So here is worth a try instead!

Last edited by DAN682; 23-02-2010 at 04:49 PM.
Reply With Quote