I am only interested in x64 windows...
Thanks for considering...
Code: Select all
Enumeration COMPUTER_NAME_FORMAT ;thanks to jacdelad
#ComputerNameNetBIOS ;[computer name]
#ComputerNameDnsHostname ;[computer name]
#ComputerNameDnsDomain ;[domain]
#ComputerNameDnsFullyQualified ;[computer name].[domain]
#ComputerNamePhysicalNetBIOS ;[computer name]
#ComputerNamePhysicalDnsHostname ;[computer name]
#ComputerNamePhysicalDnsDomain ;[domain]
#ComputerNamePhysicalDnsFullyQualified ;[computer name].[domain]
#ComputerNameMax ;[empty]
EndEnumeration
Import "Kernel32.lib"
GetComputerNameExW(NameType, *lpBuffer, *nSize)
EndImport
Procedure.s GetComputerName(NameType = #ComputerNamePhysicalDnsFullyQualified)
Protected *lpBuffer, nSize = 4096
Protected.s name
*lpBuffer = AllocateMemory(4096)
If GetComputerNameExW(NameType, *lpBuffer, @nSize)
name = PeekS(*lpBuffer, nSize)
EndIf
FreeMemory(*lpBuffer)
ProcedureReturn name
EndProcedure
result$=""
For x = #ComputerNameNetBIOS To #ComputerNameMax
result$ + Str(x)+":"+GetComputerName(x)+#CRLF$
Next
SetClipboardText(result$)