I am using this code in a batch file:
for /f %%f in ('"net user %user% /domain | findstr /i %group%"') do set /a i=%i%+1
It looks like no matter what %user% you type in it will still set %i%+1 equaling 1... even if the %user% is not found.
If the %user% is not found, NET USER reports saying the user was not found, but because %i%=1 it continues on in the script.
How would I go about getting this to work? If the %user% is not found in /Domain then %i% needs to = 0