Discussion Locked

Finding the workgroup of a machine

0 helpful
11 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi all,

My name is Derek and I currently have an EXE that is running on the user machine. each time the user runs the EXE it needs to check which Workgroup the user is connected too. Do you know how I can code that in VB.

11 replies

by curacao_dejavu

for winnt check
hkeylocalmachine\software\microsoft\windows nt\current version\winlogon.

in win98 it's in a almost similar place.

regards, Leopold

by mike (from canada)

I'm sure the workgroup name is somewhere in the registry. In the code, change the word "regkey" to what you see at the status bar in the registry ediitor when you have found the workgroup name. Here is the code:

x% = shell("REGEDIT.EXE /E regkey c:\dummy.reg",3)
open "c:\dummy.reg" for input as #1
do until eof(1)
line input #1,a$
' put the appropiate condition here
loop
close #1

I dont exactly know the format once a registry key is copied to a file. but after the first statement, you will have a c:\dummy.reg whichs shows the workgroup information.

by estebandelatorre

You can retreive the workgroup name by querying/changing the registry key value of HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\VNETSUP\Workgroup
Also the net config command will show you the workgroup configured along with tha machinename and something else

This discussion is closed to new replies.