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.