title: Using batch script to find filename and run a convert command using that filename
body: <p>I'm attempting to grab a text file from a folder for conversion to .xls using <code>ssconvert</code>. Currently I have: </p>
  
  <pre><code>for /F %%a in ('dir /b *.txt') do set FileName=%%~na 
  ssconvert %FileName%.txt %FileName%.xls
  </code></pre>
  
  <p>However this results in this being run:</p>
  
  <pre><code>ssconvert thefile .txt thefile .xls
  </code></pre>
  
  <p>Which obviously doesn't work.</p>
  
  <p>How would I get rid of the space between the <code>FileName</code> variable and the file extension?</p>