How do I get the WORKGROUP in XP Home.

Posted on 2005-04-08
Last Modified: 2012-08-13
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:


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?
Question by:dzumwalt
    LVL 19

    Expert Comment

    LVL 19

    Accepted Solution

    LVL 32

    Expert Comment

    Way 1:
    Obtaining Workstation Configuration and Current User

    Way 2:
    Using WMI (NT4 or better required)

    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

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now