• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • Last Modified:

How do I get the WORKGROUP in XP Home.

I am writing a VB6 application that will need to obtain the workgroup.

I have read other answers that deal with obtaining the workgroup in the registry under the following path:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Vxd\VnetSup\WorkGroup

The problem is that when I look on my PC (running XP-Home) there is no Vxd key under the services branch. Assuming that it must be something specific to my operating system, what method can I use to obtain the workgroup regardless of the OS?
0
dzumwalt
Asked:
dzumwalt
  • 2
1 Solution
 
ShauliCommented:
0
 
ShauliCommented:
0
 
Erick37Commented:
Way 1:
Obtaining Workstation Configuration and Current User
http://vbnet.mvps.org/code/network/netwkstagetinfousername.htm

Way 2:
Using WMI (NT4 or better required)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__accounts_and_domains.asp

Dim strComputer As String
Dim objWMIService As Object
Dim colSettings As Object
Dim objComputer As Object

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery _
    ("Select * from Win32_ComputerSystem")
For Each objComputer In colSettings
    Debug.Print "System Name: " & objComputer.Name
    Debug.Print "Domain: " & objComputer.domain
Next
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now