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.
1. Ping
Simply Ping the localhost in the Command Prompt and you will see the computer name right in the output.
ping localhost
2. Hostname
As the name implies, the only thing this command returns is the name of your computer.
3. IPConfig
Run the command with /all switch, you will see the computer name in the beginning of the output.
4. WhoAmI
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.
6. Echo
That’s right, the command echo can also give away your computer name in a blink.
echo %computername%
7. Set
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.
8. Tracert
Last but not least, tracert localhost returns the name of your computer in the output.
tracert localhost
That’s all I can think of for the moment. If you can think of anything, feel free to share.