title: Batch strings conversion
body: <p>Please, tell me what is wrong in my batch-script? The task is to compare files names in the specific folder with an integer variable. There are two issues:</p>
  
  <ol>
  <li>Files names consist of numbers and may contain spaces and leading zeroes (e.g. 01.cmd, 0 02.cmd, 0 0 3.cmd, e.t.c.), which, I suppose, have to be deleted for further comparison with an integer variable.</li>
  <li><p>Convert files names variable from string type to integer to compare with an integer variable. </p>
  
  <p>Here is the text of the script:</p>
  
  <pre><code>SetLocal EnableDelayedExpansion
  
  for /f "usebackq delims=" %%i in (`dir /b C:\tmp`) do
   rem delete spaces in the files names
   echo %%i
   set i=%%i: =%
   echo %%i  &amp;::this always returns me only the same file name
  
     rem int - is an integer variable to compare with
     rem in this way I tried to convert a file name to integer
    if %int% lss %%i set /a int=%%i: =% 2&gt;nul
  </code></pre>
  
  <p>In Linux Shell it would be much easy, but I'm not so familiar with batch scripting. And this script need to be run under Windows OS.</p></li>
  </ol>