Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Computer name and domain from the registry rather than API

4,913 views
Skip to first unread message

riglee

unread,
Aug 30, 2004, 12:25:19 PM8/30/04
to
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

unread,
Sep 1, 2004, 2:24:47 AM9/1/04
to
And after reboot still you have the old name ? Just a hint
Arkady

"riglee" <rig...@nospam.gov> wrote in message
news:%23L00x3q...@tk2msftngp13.phx.gbl...

Carl Appellof

unread,
Sep 1, 2004, 11:58:12 AM9/1/04
to

"riglee" <rig...@nospam.gov> wrote in message
news:%23L00x3q...@tk2msftngp13.phx.gbl...
> 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

unread,
Sep 1, 2004, 2:38:54 PM9/1/04
to
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.


"Carl Appellof" <carl dot appellof at veritas dot com> wrote in message
news:e8WA%23xDkE...@TK2MSFTNGP10.phx.gbl...

bseshi...@gmail.com

unread,
Sep 2, 2012, 12:28:38 PM9/2/12
to riglee
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/
0 new messages