title: How to exclude file extensions in the output filelist.txt, within a batch "dir" script in CMD
body: <p>I am a CMD newbie and have a question with a batch script I am working on.
  I have a parent directory with 30 sub-directories containing .pdf files, and I need a filelist.txt for each sub-directory, and have each filelist.txt save as the file name of the sub-directory it belongs too. This has been completed with the script below:</p>
  
  <pre><code>     @echo off
       cd /d "C:\Desktop\parentDir"
              for /d %%a in (*) do ( 
              DIR /B /ON /A-D "%%a" &gt; %%a.txt.  
              move %%a.txt "%%a" &gt;nul 
          )
  </code></pre>
  
  <p>My question is how, can I remove file extensions in the output of each filelist.txt. For ex. when I run the script now, the output .txt file shows 1111.pdf
  1112.pdf
  I need the ".pdf" removed</p>
  
  <p>I know with a "for" command you can "do" echo %%~na to remove file extensions, but I have no clue how/where to factor this into the current script.</p>
  
  <p>Any help is appreciated!</p>