groups.bat
dsquery user -samid %1| dsget user -memberof | wc
C:\>groups testuserC:\>dsquery user -samid testuser | dsget user -memberof | wc 215 635 16530C:\>
The number of groups is 215.
You need the WC unix utility. I always keep WC and GREP on hand.