Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Wednesday, February 12, 2020 5:15 PM
The only two registry keys relating to computer name I know of are:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName
and
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName
but when I rename my PC to be a name longer than 15 characters (ex: OneTwoThreeFourFive) and recheck HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName, I only see the first 15 characters and it's in all caps, abiding to NetBIOS format (ex: ONETWOTHREEFOUR).
However, when I restart my computer, my computer name changes to OneTwoThreeFourFive. $(hostname) gives me the full, true name just fine as well. Where is the name being stored?
All replies (6)
Thursday, February 13, 2020 1:25 AM | 1 vote
Hi,
Your description is correct, these two registry keys shows computer name.
Looks like there is no registry key that stores full computer name. Computer name and domain name are stored separately. You can query both these registry key values and then combine them to get the full computer name.
Hope above information can help you.
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].
Monday, February 17, 2020 8:23 AM
Hi,
Just checking in to see if the information provided was helpful.
If the reply helped you, please remember to mark it as an answer.
If no, please reply and tell us the current situation in order to provide further help.
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].
Monday, February 17, 2020 2:21 PM
Hi Farena,
Thank you for confirming that my description was correct. I tried out your suggested queries via Powershell:
- Reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName /v computername
- Reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TcpipParameters /v Hostname
- Reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TcpipParameters /v Domain
All printed out "ERROR: The system was unable to find the specified registry key or value."
What's more confusing is that when I check via the Registry Editor, I do have a
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName, so I'm confused why this query did not return anything.
I do not have HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TcpipParameters, so I do expect the 2nd and 3rd query to return such a message.
I tried these queries as Administrator and as normal permissions, and they yield the same results.
Are there any alternative suggestions?
Tuesday, February 18, 2020 7:42 AM | 1 vote
Hi,
I have done a test and did not return anything either.
Thanks for your correction.
So far, there is no definite answer.
Or you may refer to the following link for some information:
https://superuser.com/questions/861444/recover-previous-computer-names
Note: This is a third-party link and we do not have any guarantees on this website. And Microsoft does not make any guarantees about the content.
Best Regards,
Farena
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].
Friday, February 28, 2020 2:48 PM
Looks like it remains a mystery then, though I'm puzzled that I haven't found what I'm looking for yet.
Thank you for your time, Farena.
Monday, March 2, 2020 7:42 AM
Hi,
Thank you for sharing your experience here.
Let's look forward to other reply from forum users.
Best Regards,
Farena
"Windows 10 Installation, Setup, and Deployment" forum will be migrating to a new home on Microsoft Q&A (Preview)!
We invite you to post new questions in the "Windows 10 Installation, Setup, and Deployment" forum’s new home on Microsoft Q&A (Preview)!
For more information, please refer to the sticky post.