> Hello there,
> How do I get the computer name from within a script or a visual Basic
> program!
>
> May thanks
Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA"
(ByVal lpBuffer As String, nSize As Long) As Long
Public Property Get ComputerName() As String
Dim lMaxNameLength as Long
Dim sComputerName As String
lMaxNameLength = 255
sComputerName = String$(lMaxNameLength , 0)
If GetComputerName(sComputerName, lMaxNameLength ) <> 0 Then
ComputerName = Left$(sComputerName, InStr(1, sComputerName,
vbNullChar) - 1)
Else
Err.Raise 1001, "GetComputerName", "Failed to get computer name"
End If
End Property

Signature
Anthony Jones - MVP ASP/ASP.NET