|I had already tested | and ^| before posting. |
After some testing I found out that the error message that I wanted to remove was being produced only for a certain account. This account contains a space (e.g. myTest User), which throws an error when called via net user.
Is there any way to test for this error in the code below:
"The user name could not be found."
"More help is available by typing NET HELPMSG 2221"
Also the code below is producing another error, which is that it query an account name (e.g. myAccountName) twice. The first time it returns all the account details, while the second time it only returns the name without the account details. Any idea on this one?
FOR /F "skip=4 tokens=*" %%A IN ('NET USER ^| FIND /V "The command completed successfully"') DO CALL :ParseUsers %%A
FOR %%? IN (%*) DO CALL :ChkAcc %%?
Net User %1 | find /V "The command completed successfully"
Thanks in advance for any support.