regObj.DLL issues 
Author Message
 regObj.DLL issues

I am using this component (regobj.dll) to pull information from remote
registries.

Specifically - I am using the code below:

const key3 =
"\HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\SERVICES\LanManWorkStation\Lin
kage\"
Set objReg = CreateObject("RegObj.Registry")
Set objRemote = objReg.RemoteRegistry(servername) 'this is a variable that
is retrieved from a text file - remote machine name
Set lanmanbound = objRemote.RegKeyFromString(key3)
wscript.echo("Bind is = " & lanmanbound.values("Bind").value)

What I am trying to do is pull all of the infomration from that key (--all
the services that are bound to the LanManWorkstation Service).

The data in the value Bind is (I clipped out data and just dropped in etc
(sorry for paranoia).

\Device\NetbiosSmb
\Device\NetBT_Tcpip_{C2216ED3-etc.}
\Device\NetBT_Tcpip_{6BA0F80B-etc}
\Device\NetBT_Tcpip_{29B3EAD4-etc}
\Device\NetBT_Tcpip_{D2017149-etc}
\Device\NetBT_Tcpip_{C48F990A-etc}

The data actually is seperated by spaces - and that appears to be my
problem.  When I attempt to get all of this data using the code above - all
I get back is

Bind is = "NetbiosSmb"

It appears to pull the data until it sees a space - damn frustrating.  I
need all of that data - any help ?



Fri, 25 Jul 2003 13:19:20 GMT  
 regObj.DLL issues
Hi,

Quote:

>I am using this component (regobj.dll) to pull information from remote
>registries.

>Specifically - I am using the code below:

>const key3 =
>"\HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\SERVICES\LanManWorkStation\Lin
>kage\"
>Set objReg = CreateObject("RegObj.Registry")
>Set objRemote = objReg.RemoteRegistry(servername) 'this is a variable that
>is retrieved from a text file - remote machine name
>Set lanmanbound = objRemote.RegKeyFromString(key3)
>wscript.echo("Bind is = " & lanmanbound.values("Bind").value)

>What I am trying to do is pull all of the infomration from that key (--all
>the services that are bound to the LanManWorkstation Service).

>The data in the value Bind is (I clipped out data and just dropped in etc
>(sorry for paranoia).

>\Device\NetbiosSmb
>\Device\NetBT_Tcpip_{C2216ED3-etc.}
>\Device\NetBT_Tcpip_{6BA0F80B-etc}
>\Device\NetBT_Tcpip_{29B3EAD4-etc}
>\Device\NetBT_Tcpip_{D2017149-etc}
>\Device\NetBT_Tcpip_{C48F990A-etc}

>The data actually is seperated by spaces - and that appears to be my
>problem.  When I attempt to get all of this data using the code above - all
>I get back is

>Bind is = "NetbiosSmb"

>It appears to pull the data until it sees a space - damn frustrating.  I
>need all of that data - any help ?

'Make an adjustment according to the RegValueType of your value:
' begin code

on error resume next
if lanmanbound.values("Bind").type = rvMultiString then
    ' Value is an set of STRINGs seperated by chr$(0)
    dim arStr, nCount, nJ, sOut
    arStr = split( lanmanbound.values("Bind").value, chr(0))    
    nCount = ubound(arStr)
    if not err.number then
        for nJ = lbound(arStr) to nCount
            sOut = sOut & arStr(nJ) & vbCrLf
        next
    end if
    WScript.echo sOut
else
' you have some other kind of value  - string or binary
end if

' end code

Hope this helps,
Mark Pryor



Fri, 25 Jul 2003 20:44:55 GMT  
 regObj.DLL issues
Mark,

Never got a chance to thank you - using the strip function was the ticket -
that gives me the one dimensional array that  I can combine (as you did) -
or keep seperate and iterate through (as I did later in my script).

Thanks for the tip !!

Dan


Hi,

Quote:

>I am using this component (regobj.dll) to pull information from remote
>registries.

>Specifically - I am using the code below:

>const key3 =
>"\HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\SERVICES\LanManWorkStation\Li
n
>kage\"
>Set objReg = CreateObject("RegObj.Registry")
>Set objRemote = objReg.RemoteRegistry(servername) 'this is a variable that
>is retrieved from a text file - remote machine name
>Set lanmanbound = objRemote.RegKeyFromString(key3)
>wscript.echo("Bind is = " & lanmanbound.values("Bind").value)

>What I am trying to do is pull all of the infomration from that key (--all
>the services that are bound to the LanManWorkstation Service).

>The data in the value Bind is (I clipped out data and just dropped in etc
>(sorry for paranoia).

>\Device\NetbiosSmb
>\Device\NetBT_Tcpip_{C2216ED3-etc.}
>\Device\NetBT_Tcpip_{6BA0F80B-etc}
>\Device\NetBT_Tcpip_{29B3EAD4-etc}
>\Device\NetBT_Tcpip_{D2017149-etc}
>\Device\NetBT_Tcpip_{C48F990A-etc}

>The data actually is seperated by spaces - and that appears to be my
>problem.  When I attempt to get all of this data using the code above - all
>I get back is

>Bind is = "NetbiosSmb"

>It appears to pull the data until it sees a space - damn frustrating.  I
>need all of that data - any help ?

'Make an adjustment according to the RegValueType of your value:
' begin code

on error resume next
if lanmanbound.values("Bind").type = rvMultiString then
    ' Value is an set of STRINGs seperated by chr$(0)
    dim arStr, nCount, nJ, sOut
    arStr = split( lanmanbound.values("Bind").value, chr(0))
    nCount = ubound(arStr)
    if not err.number then
        for nJ = lbound(arStr) to nCount
            sOut = sOut & arStr(nJ) & vbCrLf
        next
    end if
    WScript.echo sOut
else
' you have some other kind of value  - string or binary
end if

' end code

Hope this helps,
Mark Pryor



Sun, 27 Jul 2003 18:04:43 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Reading REG_BINARY Keys with RegObj.dll

2. sfImpersonator and RegOBJ.dll

3. regobj.dll

4. regobj.dll

5. RegObj.dll

6. Newbie needs help in reading installed programs from the registry using RegObj.dll

7. RegObj.dll question

8. regobj.dll

9. Reading binary registry values using regobj.dll

10. RegObj.dll and Windows 9x

11. Adding a value to the registry of a remote PC using REGOBJ.DLL

12. RegObj.dll - Newbie Example

 

 
Powered by phpBB® Forum Software