Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the discussions about computer names in vbs

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "what are the related discussions about computer names in vbs?" friends who are interested may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the discussions about computer names in vbs?"

Discussion on computer name

Q: my computer-> Properties-> computer name-> computer description, I want to change it here, but it is gray and unwritable.

A: this will happen if lanmanserver service is not enabled. Just execute "net start srv".

Q: I want to modify my working group, but it's gray and unwritable.

A: this will happen if lanmanworkstation service is not enabled. Just execute "net start rdr".

Q: how to change 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 commonly referred to in natural language is very imprecise, so here is a precise 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 ComputerName will

It is copied to ActiveComputerName on the next reboot.

"." Corresponding to the current FQDN (full domain name), "." Set

It is copied to "." when the next station is rebooted. Where.

Obviously, we have two names, one is NetBIOS name, the other is FQDN, and there is no necessary connection between them.

Although they are consistent most of the time. The NetBIOS name can be used in many places, such as TCP/IP, IPX/SPX,

NetBEUI and others have realized the communication protocol of NetBIOS interface. FQDN is only used for the TCP/IP protocol. Microsoft in the name solution

The analysis of the problem has undergone many changes, and the parsing order of names is different, so it is difficult for end-users to distinguish NetBIOS names from

FQDN . For example, what kind of name "ping" uses, there will be multiple variants, depending on the operating system and network.

Topology, which will not be discussed in detail here. In short, remember that when it comes to computer names, there are two names.

When you change the computer name on GUI, what you actually do 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 can see why it takes a restart to change the computer name on GUI to take effect.

It is generally not recommended to directly manipulate the registry to modify these values, you can consider 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 demonstrated by backend. This method is completely equivalent to the GUI modification method, and can be repaired at the same time.

Changed the name of NetBIOS and FQDN, and take effect after restart. Note that the NetBIOS name is automatically transferred when the two methods are modified.

Switch to uppercase, while FQDN remains case-sensitive.

If you use the registry monitor to observe the hostname.exe, you will find that the command only fetches the Hostname in the FQDN, not

Take the NetBIOS name. "nbtstat-A" refers to the NetBIOS name. What devmgmt.msc takes is

The NetBIOS name at ActiveComputerName.

If HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Control\ ComputerName is destroyed

Check the NetBIOS name in my computer, it may be blank. If you visit "\\ ipc$" at this time, you will make an error. Microsoft

The error message given is basically useless. Grab the packet and find that there is no IP message, the error level is very high, and it has not yet arrived.

IP layer. Visiting "\\ ipc$" can be successful. This is what happened to flier. It should be to install some software.

There is something wrong with directly operating the registry to change the name of the computer.

Q: open disk management in XP and report "RPC service is not available".

A:

This is the computer name and ActiveComputerName used by the "Logical Disk Manager/dmserver" service.

The mismatch of NetBIOS names is usually caused by the destruction of the latter. If you cannot recover after restarting OS, please

Reset the computer name on GUI, and it should be fine.

At this point, I believe you have a deeper understanding of "what are the relevant discussions about computer names in vbs?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report