Windows already have a few built-in GUI-based tools that you can use to find the name of your computer, i.e. System in Control Panel and System Information tool. But what I am about to show is a number of built-in command-lines, 8 more precisely, that you can also use to reveal the same information as well. Check it out.
Simply Ping the localhost in the Command Prompt and you will see the computer name right in the output.
As the name implies, the only thing this command returns is the name of your computer.
Run the command with /all switch, you will see the computer name in the beginning of the output.
The command returns the username along with the computer name. If you want to know more about this computer, check out this post.
5. Net User
The command returns a list of user accounts on your computer but it also includes the computer name in the output as well.
You can also use net localgroup as well to get the same information.
That’s right, the command echo can also give away your computer name in a blink.
The command Set returns the full list of environment variables available in the system, one of them on that list, %computername%, is the one we just used in the above command.
Last but not least, tracert localhost returns the name of your computer in the output.
That’s all I can think of for the moment. If you can think of anything, feel free to share.