title: Making backup with batch file - copy to the same subdirectory but on another drive
body: <p>I made my batch file that allows me to make automatic backup particular types of files from harddrive into flashdrive. Now my script copy all files into one folder. </p>
  
  <p>I want it to copy files to the same subdirectory as origin like in example below: </p>
  
  <p>form 
  C:/<strong>vacation_photos_2017</strong>/pic1.jpg 
  to 
  E:/BackUpScript/BackUp/<strong>vacation_photos_2017</strong>/pic1.jpg</p>
  
  <p>Can anyone help me with this?</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>SET FileSizeMin=20000
  SET ExcludeList=%ExcludeList%%~d0\BackUpScript\exclude_list.txt
  SET BackUpDir=%BackUpDir%%~d0\BackUpScript\BackUp
  
  if exist %ExcludeList% del "%ExcludeList%"
  echo.&gt; %ExcludeList%
  echo \Filmy\&gt;&gt; "%ExcludeList%"
  echo \Seriale\&gt;&gt; "%ExcludeList%"
  
  for %%d in (C:\ D:\) do (
      PUSHD %%d
      for /f "delims=" %%F in ('Dir /B/S/A *.jpg *.jpeg *.nef *.dng *.mp4 *.mov *.wmv *.avi *.3gp *.3g2 *.gif') do if %%~zF GTR %FileSizeMin% (xcopy /s/h/y/c /exclude:%ExcludeList% "%%F" "%BackUpDir%\")
      POPD
  )
  del "%ExcludeList%"
  exit 0
  </code></pre>
  
  <p>[EDIT]</p>
  
  <p>Ok, I have rewrite the script ussing Robocopy, it works as I want to (code below) but...
  Afret batch script is done the main <strong>BackUp3</strong> folder (where script copied files) is hidden by a script. Script is hidding direcory in the way I cannot unhide (I dont know why). </p>
  
  <p>Why this batch script is hidding my BackUp directory? Why I cannot unhide it by checking "show hidden files" in Folder Options?</p>
  
  <pre><code>SET BackUpDir=%~d0\VisualStudio\ArchitectureExplorer\BackUpDir3
  
  for %%d in (E:\ F:\ G:\ H:\ I:\) do (
      if exist %%d (
      robocopy %%d %BackUpDir% *.jpg *.jpeg *.mp4 *.mov *.wmv *.avi *.3gp *.3g2 *.gif /MIN:20000 /s /W:15 /XD %%dFilmy %%dSeriale )
  )
  exit 0
  </code></pre>