There are several ways to get the computer name from a command prompt. Here's a short listing of possible solutions for you, at a command prompt enter the command listed on the first line of each choice and it will return the computer's name in the format below the command.
For some of the commands I've added a modified query that uses the "find" command that will filter out the other noise from the display and just show you the line that contains the computer's name.
_______________
1) hostname
This is the simplest command that is included with some versions of Windows and returns the computer's name without a bunch of other unwanted information.
_______________
2) ipconfig /all
Host Name ...
There's a bunch of information on this screen, but the 'host name' is there, too.
Modified,
2b) ipconfig /all | find /i "host name"
_______________
3) set
COMPUTERNAME=
This lists a bunch of different environment variables that your computer uses. Near the top is your "computername" value.
Modified,
3b) set | find /i "computername"
_______________
4) net statistics workstation
Workstation Statistics for \\
This is sort of cheating to get your computer name. The "net" command is used to get other information, but by default, it tells you what computer it's getting the information about.
Modified,
4b) net statistics workstation | find /i "workstation"
_______________
5) net config workstation
Computer name \\
Similar to #4
Modified,
5b) net config workstation | find /i "computer name"
_______________
6) ping -a 127.0.0.1
Pinging .domainname
The "-a" switch on the ping command tells it to also resolve the name associated with the ip address. The address 127.0.0.1 is always associated with your local computer (the local loopback, actually) and will resolved to your computer's name.
Modified,
6b) ping -a 127.0.0.1 | find /i "pinging"
_______________
7) ping localhost
Pinging .domainname
Same as #6, but using the name "localhost"
Modified,
7b) ping localhost | find /i "pinging"
_______________
8) winmsd
System Name
This command actually calls up a GUI window of the Microsoft System Information screen, so it isn't strictly using the commandline to display the information.
______________
Notes:
The symbol that I'm using before the "find" command " | ", is called a "pipe" and it's the other character on the backslash key above the enter key.
The "/i" parameter on the "find" command tells it to ignore the case of the text I'm searching for. This can make it easier to find the actual text that is specified with the find command.
2007-05-06 00:52:01
·
answer #1
·
answered by Kevin 7
·
8⤊
1⤋
Start, run, type in "cmd" without quotes, or "command" without quotes, click ok. Type in 'ipconfig/all" and push enter to see computer name.
2007-05-05 05:59:48
·
answer #2
·
answered by christianprogrammer2 4
·
0⤊
4⤋
I guess you're looking for the hostname...
IPCONFIG /ALL
It's on the first line.
2007-05-05 05:59:34
·
answer #3
·
answered by Anonymous
·
1⤊
1⤋
Start -> Run -> Type cmd -> Then press ENTER , you will see BLACK screen , its command prompt.
2007-05-05 05:58:30
·
answer #4
·
answered by jok3r 4
·
0⤊
7⤋
"net statistics workstation" will show you
2007-05-05 05:59:14
·
answer #5
·
answered by Anonymous
·
0⤊
1⤋