title: How to empty keyboard buffer in a DOS batch?
body: <p>I've made a simple batch script to  generate CodeIgniter folder structure (scaffolding) but... the script remembers the last value of the %1 enviroment variable because there is a keyboard buffer. Any simple solution? I'm using Windows 7</p>
  
  <pre><code>@echo off
  REM by Pablo Bozzolo (2011)
  
  REM HOW to empty keyboard buffer before ???
  if "%1"=="" goto inicio
  set (%uname%)=(%1)
  goto creacion
  
  :inicio
  set /P uname=Nombre del modulo ? 
  if "%uname%"=="" goto inicio
  
  echo Desea crear el modulo %uname%
  choice 
  if errorlevel 2 goto end
  
  :creacion
  mkdir %uname%
  cd %uname%
  mkdir config
  mkdir controller
  mkdir libraries
  mkdir models
  mkdir views
  
  type NUL &gt; ./controller/%uname%.php
  type NUL &gt; ./models/%uname%_m.php
  cd..
  echo Modulo %uname% creado!
  goto end
  :end
  </code></pre>