See the FAQ forum on the use of RUN/SHELL and quotes.

You shoudl rather assembe the shell command as a string and then feed toe compleet strng into SHELL
Code:

$shellcmd='%COMPSEC% /c \\<server>\<share>\showmbrs "<domain>\'+$group+'" >> "\\<machine>\<share>\'+$group+'.txt"'
? 'SHELL command = '$shellcmd
SHELL $shellcmd

_________________________
There are two types of vessels, submarines and targets.