title: Creating-deleting new user accounts on Windows 7 OS
body: <p>I want to create and delete new users on my code.  I managed to create with "NetUser" class's "createUser()" functions but when I set the options as in the references to create a standard user, it still creating as a guest account. Is there anyone knows what is the reason of my problem? </p>
  
  <p>I am using this code:</p>
  
  <pre><code>//userinfo structure:
  
   ui.usri1_name = username;
   ui.usri1_password = password;
   ui.usri1_priv = USER_PRIV_USER;
   ui.usri1_home_dir = NULL;
   ui.usri1_comment = NULL;
   ui.usri1_flags = UF_SCRIPT;
   ui.usri1_script_path = NULL;
  
  //Creating user:
  
  DWORD dwLevel = 1;
  DWORD dwError = 0;
  NET_API_STATUS nStatus;
  nStatus = NetUserAdd(L"localhost",dwLevel,(LPBYTE)&amp;ui,&amp;dwError); 
  </code></pre>
  
  <p>This should create a new user account to be a standard user account but it is always creating a quest user account. This function is running in a credential provider hence I don't think the problem is about the permissions. For more information about the NetUserAdd function <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa370649%28v=vs.85%29.aspx" rel="nofollow">click</a>.</p>