Windows 10 Tip: 8 Command Lines to Find Your Computer Name


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.

System to find Computername

1. Ping

Simply Ping the localhost in the Command Prompt and you will see the computer name right in the output.

ping localhost

Command Prompt - Ping localhost

2. Hostname

As the name implies, the only thing this command returns is the name of your computer.

Command Prompt - hostname

3. IPConfig

Run the command with /all switch, you will see the computer name in the beginning of the output.

Command Prompt - ipconfig all

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.

Command Prompt - whoami

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.

Command Prompt - net user

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%

Command Prompt - 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.

Command Prompt - Set

8. Tracert

Last but not least, tracert localhost returns the name of your computer in the output.

tracert localhost

Command Prompt - tracert

That’s all I can think of for the moment. If you can think of anything, feel free to share.



Please enter your comment!
Please enter your name here