Read command result as variable

Hi all,

Is there a simple way to read a command output as a variable? I've running a batch file to do:
attrib.exe * | find /c /v "" >filecount.txt

but rather than write it to the txt file I'd like to read the total in as a variable to pass to the rest of the bat file...

Any help much appreciated como siempre..

It may be possible using one of for's many strange options but this is something it's always been tortuous to do in Windows CMD; there's no obvious, direct equivalent to backticks like a UNIX shell has.