Faster way to find out if a user exists on a system?

前端 未结 4 1188
陌清茗
陌清茗 2020-12-08 23:50

I have an application that checks to see if a user exists (if not create it) every time it starts. This is done as follows:

bool bUserExists = false;
Directo         


        
4条回答
  •  既然无缘
    2020-12-09 00:35

    The following in a command prompt returns 1 if 'username' exists.

    net user | find "username" /c

提交回复
热议问题