_WORKGROUP — Returns the name of the computer’s workgroup.
_WORKGROUP
Syntax: %_WORKGROUP
%_WORKGROUP
If the computer is a member of a domain, this variable returns an empty string.
echo %_workgroup