title: copy file from one path to another with a 'variable folder name' in the path - batch file
body: <p>I got a problem in copying a file from one path to another path with a 'variable folder name' in the path</p>
  
  <p>The following code works fine if the folder name doesnot have a space in it.(hear Folder1 is the variable folder name)</p>
  
  <p>CODE:</p>
  
  <pre><code>@echo off&amp;setlocal enabledelayedexpansion
  
  SET inpu="Folder1"
  ::SET /p fil=enter file name: 
  
  
  for /f "delims=" %%x in ('dir "C:\Users\kumark3\Desktop\"%inpu% /ad /b') do (
  set /a userslen+=1
  set "usersarray!userslen!=C:\Users\kumark3\Desktop\%inpu%\%%x"
  )
  
  
  for /l %%x in (1,1,%userslen%) do (
  
  xcopy "!usersarray%%x!\geth\gr.txt" "C:\Users\kumark3\Desktop\Folder2" /c /h /r /y /i
  
  )
  </code></pre>
  
  <p>But if the folder name has a space, the code is not working
  for eg if the 2nd line in the code is like </p>
  
  <p>SET inpu="Folder 1"</p>
  
  <p>Please give me a solution for this problem</p>