DOS check if user exists

May 11, 2009 at 21:47:04
Specs: Windows XP

I need to check whether an user exists before i perform certain tasks with the user. Is there a DOS command to do it? Something like "if exist net user ABC....."

I know i can write the net user command out to a text file and check against the file but this would be my last option.

Thanks a lot

See More: DOS check if user exists

Report •

May 13, 2009 at 02:21:31
net user klint >nul 2>&1 && echo User Exists || echo User doesn't exist

Report •

May 13, 2009 at 03:06:14
Thanks very much klint!!! this works great!!!!

actually i have created a vbscript for that using errorlevel as the return value from the vbs.

but this is just what i wanted!!! thanks again :D

Report •

Related Solutions

Ask Question