General discussion

Locked

Finding the workgroup of a machine

By dwtk9 ·
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.

This conversation is currently closed to new comments.

11 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Finding the workgroup of a machine

For Win98 see registry key:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\VNETSUP\Workgroup
This appears to hold the workgroup name.
If you're not familiar with accessing the registry see the articles at
http://www.vbworld.com/registry/registry2/
(beware of spaces in url)
Hope this helps
John

Collapse -

Finding the workgroup of a machine

by dwtk9 In reply to Finding the workgroup of ...

Poster rated this answer

Collapse -

Finding the workgroup of a machine

by Curacao_Dejavu In reply to Finding the workgroup of ...

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

in win98 it's in a almost similar place.

regards, Leopold

Collapse -

Finding the workgroup of a machine

by dwtk9 In reply to Finding the workgroup of ...

Poster rated this answer

Collapse -

Finding the workgroup of a machine

by sl-campbell In reply to Finding the workgroup of ...

Go to MS Knowledge base:
http://search.support.microsoft.com/kb/c.asp?fr=0&SD=GN&LN=EN-US

Do a search on this Article:

Q148835

This will show you how to get the workgroup information of Win32 machines via API calls.

If you have problemsfinding the Article, send me an e-mail. I can then send you the Code.

Collapse -

Finding the workgroup of a machine

by dwtk9 In reply to Finding the workgroup of ...

Poster rated this answer

Collapse -

Finding the workgroup of a machine

by Mike (from Canada) In reply to Finding the workgroup of ...

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.

Collapse -

Finding the workgroup of a machine

by dwtk9 In reply to Finding the workgroup of ...

Poster rated this answer

Collapse -

Finding the workgroup of a machine

by estebandelatorre In reply to Finding the workgroup of ...

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

Collapse -

Finding the workgroup of a machine

by dwtk9 In reply to Finding the workgroup of ...

Poster rated this answer

Back to Web Development Forum
11 total posts (Page 1 of 2)   01 | 02   Next

Related Discussions

Related Forums