hcrgluserp 0 Newbie Poster

trying to remove a user account from local pc's..
if account not there want to go and remove a different account
is there a way to capture the 2221 error i.e. NET HELPMSG 2221

or just a flat out if %errorlevel%..and I've seen many different ways to handle errors..what is correct for XP..?

IF NOT %ERRORLEVEL% 0........or
IF %ERRORLEVEL% == 0.......or
IF %ERRORLEVEL% EQU 0....

very confusing.


cmd /k net user localadmin /delete
if %errorlevel% == 2221 goto 1
End


:1
cmd /k net user fred /delete
if %errorlevel% <> 0 goto end
end

:End

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.