@COMPUTERNAME[n] - Returns a DNS or NetBIOS name associated with the local computer. The names are created at startup time. The type of name to be retrieved is specified by n:
0 | The NetBIOS name of the local computer or the cluster associated with the local computer |
1 | The DNS name of the local computer or the cluster associated with the local computer |
2 | The name of the DNS domain assigned to the local computer or the cluster associated with the local computer.DNS |
3 | The fully qualified DNS name that uniquely identifies the local computer or the cluster associated with the local computer |
4 | The NetBIOS name of the local computer |
5 | The DNS host name of the local computer |
6 | The name of the DNS domain assigned to the local computer |
7 | The fully qualified DNS name that uniquely identifies the computer |
Examples:
echo %computername[0]
MSI-PC