I have the equivalent of the following in a batch script:

```
net localgroup "Cool Usergroup"

```

This may succeed, or it may fail for various reasons including:

```
System error 1376 has occurred.

The specified local group does not exist.

```

or

```
System error 5 has occurred.

Access is denied.

```

The problem is I need to look for these error codes, but the output is not coming through standard out or standard error. I've tried this:

```
net localgroup "Cool Usergroup" 2>&1 > %temp%\myGarbage.txt

```

But I still get the output splashed on the screen, not in the file.

To give a little more context, my original command is running in a for loop, and I'd like to get it working inside there, but there are additional problems with that.

```
for /f "tokens=*" %i in ( 'net localgroup "Cool Usergroup" 2>&1') do echo out: %i

```

gives me:

```
2>&1 was unexpected at this time.

```

So, how do I process these system errors in a batch script using a for loop? It doesn't seem the output goes through standard error or standard out.