Events
29 Apr, 2 pm - 30 Apr, 7 pm
Join the ultimate Windows Server virtual event April 29-30 for deep-dive technical sessions and live Q&A with Microsoft engineers.
Sign up nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Displays the host name portion of the full computer name of the computer.
Important
This command is available only if the Internet Protocol (TCP/IP) protocol is installed as a component in the properties of a network adapter in Network.
hostname
Parameter | Description |
---|---|
/? | Displays help at the command prompt. |
Any parameter different than /?
produces an error message and sets the errorlevel to 1.
%COMPUTERNAME%
usually will print the same string as hostname
, but in uppercase._CLUSTER_NETWORK_NAME_
is defined, hostname
will print its value.hostname
echo %COMPUTERNAME%
set "_CLUSTER_NETWORK_NAME_=Altered Computer Name"
hostname
Events
29 Apr, 2 pm - 30 Apr, 7 pm
Join the ultimate Windows Server virtual event April 29-30 for deep-dive technical sessions and live Q&A with Microsoft engineers.
Sign up now