Get Computer Name

Wednesday, May 14, 2008

Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal sBuffer As String, lSize As Long) As Long
Public Function NameOfPC(MachineName As String) As Long Dim NameSize As Long Dim X As Long MachineName = Space$(16) NameSize = Len(MachineName) X = GetComputerName(MachineName, NameSize)End Function

0 comments

Post a Comment