Discussion:
Computer name and domain from the registry rather than API
(too old to reply)
riglee
2004-08-30 16:25:19 UTC
Permalink
I am trying to get the following information that is available via a call
to NetWkstaGetInfo. The returned struct has the following fields of
interest.

wki101_computername
wki101_langroup

I need to try and determine this information without relying on the
workstation service or the server service running. The rserver service will
be required to get the data from remote machines but I assume there is a
location in the registry that contains the information and would like to be
able to read it from the registry in all cases. I have tried the following
keys and to test them I changed the registry values and called
NetWkstaGetInfo. The result was unchanged as though I did not modify the
registry. So I assume another key is there for each but can't seem to find
it. Or, the service gets it at start up time and does not look back in the
registry when the call is made.

Here are the keys I was using and definitions I have pulled from the
following link:

http://www.jsiinc.com/SUBH/tip3900/rh3982.htm


HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveCompu
terName\ComputerName is the current NetBIOS computer name.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerNam
e\ComputerName is the NetBIOS computer name that will be used when the
computer is restarted.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Hostna
me is the host name of the computer.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\NV
Hostname is the host name that the computer will take when it is restarted.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Domain
is the current DNS domain name. Domain may be empty or not present. The full
computer name is the values of Hostname + Domain.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\NV
Domain is the DNS domain name that the computer will use when it is
restarted. The full computer name after a restart is the values of NV
Hostname + NV Domain.


Any help would be most appreciated.

Thanks
Arkady Frenkel
2004-09-01 06:24:47 UTC
Permalink
And after reboot still you have the old name ? Just a hint
Arkady
Post by riglee
I am trying to get the following information that is available via a call
to NetWkstaGetInfo. The returned struct has the following fields of
interest.
wki101_computername
wki101_langroup
I need to try and determine this information without relying on the
workstation service or the server service running. The rserver service will
be required to get the data from remote machines but I assume there is a
location in the registry that contains the information and would like to be
able to read it from the registry in all cases. I have tried the following
keys and to test them I changed the registry values and called
NetWkstaGetInfo. The result was unchanged as though I did not modify the
registry. So I assume another key is there for each but can't seem to find
it. Or, the service gets it at start up time and does not look back in the
registry when the call is made.
Here are the keys I was using and definitions I have pulled from the
http://www.jsiinc.com/SUBH/tip3900/rh3982.htm
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveCompu
Post by riglee
terName\ComputerName is the current NetBIOS computer name.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerNam
Post by riglee
e\ComputerName is the NetBIOS computer name that will be used when the
computer is restarted.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Hostna
Post by riglee
me is the host name of the computer.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\NV
Hostname is the host name that the computer will take when it is restarted.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Domain
Post by riglee
is the current DNS domain name. Domain may be empty or not present. The full
computer name is the values of Hostname + Domain.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\NV
Domain is the DNS domain name that the computer will use when it is
restarted. The full computer name after a restart is the values of NV
Hostname + NV Domain.
Any help would be most appreciated.
Thanks
Carl Appellof
2004-09-01 15:58:12 UTC
Permalink
Post by riglee
I am trying to get the following information that is available via a call
to NetWkstaGetInfo. The returned struct has the following fields of
interest.
wki101_computername
wki101_langroup
I need to try and determine this information without relying on the
workstation service or the server service running.
Why not just use the Win32 API GetComputerName() or GetComputerNameEx() ?
They don't require the workstation service or the server service.

Carl
riglee
2004-09-01 18:38:54 UTC
Permalink
I am trying to get this information from a remote machine. I have an IP
address but need to get the other information. I was hoping there was some
information as to where this data is stored. On a local machine I can get
the data as you say but those APIs are local machine only. If there are
keys I can look at I can use the same code for local and remote.
Post by Carl Appellof
Post by riglee
I am trying to get the following information that is available via a call
to NetWkstaGetInfo. The returned struct has the following fields of
interest.
wki101_computername
wki101_langroup
I need to try and determine this information without relying on the
workstation service or the server service running.
Why not just use the Win32 API GetComputerName() or GetComputerNameEx() ?
They don't require the workstation service or the server service.
Carl
b***@gmail.com
2012-09-02 16:28:38 UTC
Permalink
The Galaxy S2 was recently announced as

the manufacturer's best selling

smartphone, and is fast becoming the

handset of choice for those who are

looking for an alternative to the iPhone

4S.
.http://latestmobileforyou.blogspot.in/

Loading...