HOSTNAME.exe

Display the host name portion of the full computer name of the computer.

Syntax
      HOSTNAME

Options

   /? 	 Display Help

The hostname command is only available if the Internet Protocol (TCP/IP) is installed as a network component.

The computer hostname is usually (but not always) the same as the %COMPUTERNAME% variable.

When called with any argument other than /? hostname sets errorlevel to 1 and prints an error message.

Examples

Display the system hostname:

C:\> hostname

“There's a little bit of magic in everything, and some loss to even things out” ~ Lou Reed

Related:

echo %computername%
Equivalent PowerShell command: $env:COMPUTERNAME
Equivalent bash command: hostname


© Copyright SS64.com 1999-2013
Some rights reserved