Development‎ > ‎VBScript‎ > ‎

Get Workstation Hostname

Another piece of code:
'*********************************************************************************
'* Function signature: GetWorkstationHostname
'* Description: Retrieves local machine hostname
'*
'* Return Value
'* Local machine host name
'*********************************************************************************
Function GetWorkstationHostname
    Dim oNTInfo : Set oNTInfo = CreateObject("WinNTSystemInfo")

    GetComputerName = lcase(oNTInfo.ComputerName)
    GetWorkstationHostname = GetComputerName

    'Clean up
    Set oNTInfo = Nothing
End Function

Comments