title: Batch - check if user input is in a text file then proceed
body: <p>I am making a chat style system for LAN networked computers, and want to make a check for if username is in use or not. I can't get it to work though, here is what i have in a test file, that Does work...</p>
  
  <pre><code>@echo off
  title Testing usercheck
  
  setlocal EnableDelayedExpansion
  
  set "user2="
  set /p "user2="
  find /c "%user2%" Users.twml
  if %errorlevel% equ 1 goto yes
  goto nope
  
  
  :empty
  cls
  echo empty response, should not be triggered...
  pause
  goto end
  
  
  :yes
  cls
  echo yes, you can use that
  &gt;&gt; Users.twml echo %user2%
  pause
  goto end
  
  
  :nope
  cls
  echo nope. that is taken... try again!
  pause
  goto end
  
  
  :end
  cls
  echo.
  echo End of testing file...
  echo.
  echo press any key to exit
  pause&gt;nul
  exit
  </code></pre>
  
  <p>This takes user input, checks the file to see if it is in there, if it is, says cant use, if its not there, it says can use and saves the name to the text file so others cant pick same. However when i put it in my main file that im making the same thing doesnt work, when saving the name to file the file records</p>
  
  <pre><code>ECHO is off.
  </code></pre>
  
  <p>Being caused by this line here</p>
  
  <pre><code>&gt;&gt; Users.twml echo %user2%
  </code></pre>
  
  <p>and not the username the user entered, Strangely though it works in the test file perfectly, here is the section of my main file that doesnt work.</p>
  
  <pre><code>@echo off
  title Batch Chat Room
  mode con: cols=83 lines=10
  
  setlocal EnableDelayedExpansion
  
  
  :startup
  cls
  echo Pick A UserName
  echo 1-16 Character limit.
  set "user2="
  set /p "name2="
  if "!name2!" == "" goto startup
  if "!name2!" == " " goto startup
  if "!name2!" == "  " goto startup
  if "!name2!" == "   " goto startup
  if "!name2!" == "    " goto startup
  if "!name2!" == "     " goto startup
  if "!name2!" == "      " goto startup
  if "!name2!" == "       " goto startup
  if "!name2!" == "        " goto startup
  if "!name2!" == "         " goto startup
  if "!name2!" == "          " goto startup
  if "!name2!" == "           " goto startup
  if "!name2!" == "            " goto startup
  if "!name2!" == "             " goto startup
  if "!name2!" == "              " goto startup
  if "!name2!" == "               " goto startup
  if "!name2!" == "                " goto startup
  if not "!name2:~16!" == "" goto over
  find /c "%user2%" Users.twml
  if %errorlevel% equ 1 goto conta
  goto tryagaina
  
  
  :conta  
  cls
  echo yes, you can use that
  &gt;&gt; Users.twml echo %user2%
  pause 
  :: This pause is just for testing to add a wait here
  copy /y NUL Connected.twml &gt;NUL
  copy /y NUL Directory.twml &gt;NUL
  attrib +h Connected.twml
  attrib +h Directory.twml
  cls
  &gt;&gt; Connected.twml echo [System] %computername%:%username% Has joined as: %name2%
  &gt;&gt; Directory.twml echo [System] %name2% Has joined the chat.
  title Lightfoot Web - Batch ChatRoom - (User Typing) - (Username:%name2%)
  goto A
  
  
  :tryagaina
  goto startup
  </code></pre>
  
  <p>Here is the inside of Users.twml First 2 lines were written by the testing file, the others by my main file.</p>
  
  <pre><code>twml
  bob
  ECHO is off.
  ECHO is off.
  ECHO is off.
  </code></pre>
  
  <p>At first i tried findstr, but couldn't get it to work, so i used errorlevel as i do know how that works quite well. but it wont save name to file using my main file. Im stumped with this because the lines for Connected.twml and Directory.twml both write their content, just Users.twml will not.</p>