I have scripted EnumGroupType.bat to return the group scope and group type.

The syntax for using EnumGroupType.bat is:

call EnumGroupType GroupType Scope SecDst

Where:

<b>GroupType</b> is the <b>GroupType</b> attribute of a group.

<b>Scope</b>     is a <a href="/article/jsifaq/jsi-tip-5535-how-can-i-cause-a-called-batch-file-to-return-a-call-directed-environment-variable-.aspx">call directed environment variable</a> that will contain:
                          <b>B</b>   for a <b>Built-in</b> group.
                          <b>L</b>   for a Domain Local group.
                          <b>G</b>   for a Global group.
                          <b>U</b>   for a Universal group.

<b>SecDst</b>   is a <a href="/article/jsifaq/jsi-tip-5535-how-can-i-cause-a-called-batch-file-to-return-a-call-directed-environment-variable-.aspx">call directed environment variable</a> that will contain:
                          <b>S</b>   for a security group.
                          <b>D</b>   for a distribution group.
EnumGroupType.bat contains:
@echo off
if \{%3\}==\{\} @echo Syntax: EnumGroupType GroupType Scope SecDst&goto :EOF
setlocal
if exist "TEMP%\EnumGroupType.vbs" goto start
@echo.Dim objArgs, gt>"%TEMP%\EnumGroupType.vbs"
@echo.Set objArgs = Wscript.Arguments>>"%TEMP%\EnumGroupType.vbs"
@echo.gt = objArgs(0)>>"%TEMP%\EnumGroupType.vbs"
@echo.if (gt ANd ^&h01) ^ 0 then>>"%TEMP%\EnumGroupType.vbs"
@echo. Scope = "B">>"%TEMP%\EnumGroupType.vbs"
@echo.ElseIf (gt And ^&h02) ^ 0 Then>>"%TEMP%\EnumGroupType.vbs"
@echo. Scope = "G">>"%TEMP%\EnumGroupType.vbs"
@echo.ElseIf (gt And ^&h04) ^ 0 Then>>"%TEMP%\EnumGroupType.vbs"
@echo. Scope = "L">>"%TEMP%\EnumGroupType.vbs"
@echo.ElseIf (gt And ^&h08) ^ 0 Then>>"%TEMP%\EnumGroupType.vbs"
@echo. Scope = "U">>"%TEMP%\EnumGroupType.vbs"
@echo.End If>>"%TEMP%\EnumGroupType.vbs"
@echo.If (gt And ^&h80000000) ^ 0 Then>>"%TEMP%\EnumGroupType.vbs"
@echo. SecDst = "S">>"%TEMP%\EnumGroupType.vbs"
@echo.Else>>"%TEMP%\EnumGroupType.vbs"
@echo. SecDst = "D">>"%TEMP%\EnumGroupType.vbs"
@echo.End If>>"%TEMP%\EnumGroupType.vbs"
@echo.Wscript.Echo Scope ^& " " ^& SecDst>>"%TEMP%\EnumGroupType.vbs"
:start
for /f "Tokens=1,2" %%x in ('cscript //nologo "%TEMP%\EnumGroupType.vbs" %1') do (
 set s1=%%x
 set s2=%%y
)
endlocal&set %2=%s1%&set %3=%s2%