title: If statement in batch
body: <p>whatever I insert as docopy, the program always copies files from source to destination. <strong>Does anyone know how to fix it?</strong> <em>I want to copy files after inserting 'y' and skip it if 'n' is inserted</em>. Of course, I tried if else statement, but it didn't work properly too. After all, program should ask what part of file to rename.
  I'm sure it's easy for You :)</p>
  
  <pre><code>set source="C:\Users\Desktop\Basic"
  set destination="C:\Users\Desktop\CopyofBasic"
  set renfiles="C:\Users\Desktop\CopyofBasic"
  
  setlocal EnableDelayedExpansion
  
  
  set /p docopy="Do You want to copy files? [Y/N]: "
  
  if /i %%docopy%% == "%y%" (
      goto :makecopy
      )
  if /i %%docopy%% == "%n%" (
      goto :nagative
      )
  
  :makecopy
      xcopy /s /v /h /k /z %source% %destination%
      goto :renfiles
  :negative
      echo None files are copied.
      goto :renfiles
  
  :renfiles
  cd %renfiles%
  set /p var1="Insert part of filename to replace it: "
  set /p var2="Insert new part of filename: "
  set /p var3="Insert files fomrat: "
  
  for /r %%G in (%var3%) do (
      set "filename=%%~nxG"
      ren "%%G" "!filename:%var1%=%var2%!"
  )
  
  echo Filenames have been already changed.
  pause
  </code></pre>