Discussion on computer names in VBS _VBS

Source: Internet
Author: User
Original: http://www.opencjk.org/~scz/

A discussion about the computer name

Http://www.opencjk.org/~scz/windows/200603151441.txt

Q: My Computer-> properties-> Computer name-> computer description, I would like to change here, but it is grey and not writable.

A: This is true if the LanManServer service is not enabled. Perform "net start SRV".

Q: I'd like to modify my workgroup, but it's gray and not writable.

A: This is true if the LanmanWorkstation service is not enabled. "net start RDR" can be executed.

Q: How to modify the computer name on the command line

A:backend@nsfocus

--------------------------------------------------------------------------
Set obj = GetObject ("Winmgmts:\\.\root\cimv2")
Set list = Obj.execquery ("SELECT * from Win32_ComputerSystem")
For each X in list
X.rename (Wscript.Arguments.Item (0))
Next
--------------------------------------------------------------------------

> cscript.exe//nologo computerrename.vbs xxx

D:scz@nsfocus

The computer name in the usual natural language is very imprecise, and the following is an accurate description of the registry key associated with it:

--------------------------------------------------------------------------
Windows Registry Editor Version 5.00

[Hkey_local_machine\system\currentcontrolset\control\computername\activecomputername]
"ComputerName" = "Cloudsky"

[Hkey_local_machine\system\currentcontrolset\control\computername\computername]
"ComputerName" = "Cloudsky"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"Domain" = ""
"Hostname" = "Cloudsky"
"NV Domain" = ""
"NV Hostname" = "Cloudsky"
--------------------------------------------------------------------------

The computername at ActiveComputerName corresponds to the current NetBIOS name. Another Place computername will
be copied to activecomputername at the next reboot.

"<Hostname>.<Domain>" corresponds to the current FQDN (full name), "<nv hostname>.<nv domain>" will
Copied to <Hostname>.<Domain> at the next reboot.

Obviously, we have two names, one is NetBIOS name, the other is FQDN, there is no inevitable connection between them,
Although most of the time they are consistent. NetBIOS names can be used in many places for TCP/IP, ipx/spx,
NetBEUI realizes the communication protocol of the NetBIOS interface. The FQDN is only used for the TCP/IP protocol. Microsoft in the name solution
It is difficult for end users to distinguish between NetBIOS names and the number of different names in order to analyze problems.
Fqdn. For example, "ping <name>" what kind of name is used, there will be multiple variants, depending on the operating system, network
Topology, which is not discussed in detail here. In short, remember that when you talk about computer names, there are two kinds of names.

When you modify the computer name on the GUI, the actual action is:

--------------------------------------------------------------------------
[Hkey_local_machine\system\currentcontrolset\control\computername\computername]
"ComputerName" = "Cloudsky"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"NV Domain" = ""
"NV Hostname" = "Cloudsky"
--------------------------------------------------------------------------

Now you should understand why it is necessary to restart the computer name on the GUI to take effect.

It is generally not recommended to modify these values directly by manipulating the registry, consider the Win32 API. Setcomputername () only
can set NetBIOS name. Setcomputernameex () can be used to set the NetBIOS name or FQDN.

You can also use WMI, as backend has demonstrated. This approach is completely equivalent to the GUI modification method while repairing
The NetBIOS name and FQDN have been changed to take effect after reboot. Note that these two approaches are automatically turned when the NetBIOS name is modified
Instead of uppercase, the FQDN remains case sensitive.

Using Registry Monitor to observe Hostname.exe, you will find that the command takes only the hostname in the FQDN and does not
Takes the NetBIOS name. The "Nbtstat-a <target>" refers to the NetBIOS name. Devmgmt.msc took it.
The NetBIOS name at the ActiveComputerName.

If it destroys the Hkey_local_machine\system\currentcontrolset\control\computername,
View NetBIOS names on my computer, which may be blank. Access to "\\<ip>\ipc$" at this time, there will be errors, Microsoft
The error message given is basically useless. Grab bag found no IP message appears, error level is very high, has not yet arrived
IP layer. Access to "\\<name>\ipc$" can be successful. Flier This kind of thing, it should be to install a software
When you directly manipulate the registry to modify the computer name went awry.

Q: Open Disk Management in XP and report "RPC Service Unavailable".

A:

This is the computer name and activecomputername for the "Logical Disk manager/dmserver" service.
NetBIOS name mismatch, generally because the latter is corrupted. If you are unable to recover after restarting the OS, please
Reset the computer name on the GUI, it should be OK. See:

http://support.microsoft.com/kb/884564

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.