title: Batch File Using Net User "Username Not Found" Batch Hangs No Prompt
body: <p>My batch script does the following:</p>
  
  <ol>
  <li>user types in username and is added to a variable</li>
  <li>trick to ask for password (hides input from user) and adds to variable</li>
  <li>checks username and password authentication for domain GROUP using "net user" command</li>
  <li>If user is found in set group, continue to map drive.</li>
  <li>If user is not part of group restart at beginning</li>
  </ol>
  
  <p>This script works when the username is found.
  This script works when a username is found in a group</p>
  
  <p>The problem is if the username is NOT FOUND.
  When the user is NOT FOUND, it reports the "More help is available by typing NET HELPMSG 2221."</p>
  
  <p>It just sits there and does not continue to prompt or anything.
  I echoed the errorlevel and it comes out to 0, and reports the 0.  However it still just sits there never reaching command prompt or going where the GOTO tells it.</p>
  
  <p>I have put in errorlevels and I am unsure why it is stuck after the error message and does not continue.  It is as if the batch script is not releasing from somewhere.</p>
  
  <pre><code>@echo off
  :Question
  Echo.
  Echo.
  SET /P HelperName=Enter Witness' Name:
  Echo.
  If %HelperName% EQU %Username% GOTO SameUserName
  
  cls
  echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5&gt;%temp%\ftp.com
  set /p password=What is your password? &lt;nul
  for /f "tokens=*" %%i in ('%temp%\ftp.com') do set "password=%%i"
  del %temp%\ftp.com
  
  
  cls
  set i=0
  set group=WGD
  set user=%HelperName%
  echo Checking if %user% is member of %group%...
  for /f %%f in ('"net user %user% /domain | findstr /i %group%"') do set    /a i=%i%+1
  if %i% gtr 0 (goto :member)
  
  :nomember
  echo %user% is not member of %group% Please Try Again
  goto :question
  
  
  :member
  net use L: \\10.10.10.10\foldernamehere\TEMP /user:wgd\%helpername% %password%
  if [%errorlevel%]==[0] goto deletedrive
  goto error
  
  :deletedrive
  net use /delete L:
  goto start
  </code></pre>
  
  <p>It is as if the script in still in another function.</p>