title: Batch file to process input and export to text file
body: <p>I have a need for users to input 1-20 inputs and take those inputs and build a file with them in it.</p>
  
  <p>I have it kind of working with different functions but asking the user first how many entries would they like to enter, I would like this to ask the user to enter their entry and when done press "q" for example and this will build the file needed. </p>
  
  <pre><code>@echo off
  SETLOCAL ENABLEEXTENSIONS
  SETLOCAL ENABLEDELAYEDEXPANSION
  setlocal
  
  :mainmenu
  echo 1. 1 user
  echo 2. 2 users
  echo 3. 3 users
  set selection=
  set /p selection=Please choose a selection [1 - 3]:
  if %selection% EQU 1 goto 1user
  if %selection% EQU 2 goto 2users
  if %selection% EQU 3 goto 3users
  cls
  goto mainmenu
  
  :1user
  set /p user1=Username 1
  
  echo %user1%
  
  (
  echo rem Delete User Profiles after 2 days - Log activity to log.txt
  echo "C:\Users\Administrator\Documents\apps\delprof2\delprof2.exe /ed:%user1% /d:2 /u /i ^&gt;^&gt; "C:\temp\log.txt""
  echo rem Set following variable for file size in Bytes (1024 Bytes=1KB,  1024KB=1MB, 1024MB=1GB)
  echo SET /A FileSize=6288
  echo rem Set following variable for file extensions to check (*.* = all  files)
  echo SET Filter=log.txt
  echo rem Set following variable with path to check insided for files
  echo SET Folder=c:\temp\
  echo rem Delete the file if matches above
  echo FOR /R "%Folder%" %%F IN (%Filter%) DO (
  echo IF %%~zF GTR %FileSize% (
  echo ECHO Deleting "%%F"
  echo DEL /F "%%F"))
  echo EXIT /B /0
  ) &gt;&gt; "c:\temp\testbat.txt"
  timeout 10
  goto mainmenu
  </code></pre>