those on a windows domain or workgroup....
Posted: Fri Apr 28, 2023 9:40 pm
Any chance you could run this & let me know the results? I live mostly offgrid (generator, batteries, etc), and am working on a project for a domain & workgroup - but I only have a laptop here...
I am only interested in x64 windows...
Thanks for considering...
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$)