Function GetComputerName() On Error Resume Next Set OpSysSet = GetObject("winmgmts:\root\cimv2").ExecQuery("select * from Win32_ComputerSystem") For each i in OpSysSet ' There should only be one anyway, but we'll do this to be sure to be sure. GetComputerName = i.Name Next End Function