title: Get specific file with name containing specific string from directory using FTP
body: <p>I have made below batch file to get some files using <code>ftp</code> from server...<br>
  Now I need to get specific  file from the directory below using <code>mget</code>.
  Not all file in that directory. And I need to pass it as variable not static.</p>
  
  <blockquote>
    <p>mget /home/backup/dump/<em>.</em></p>
  </blockquote>
  
  <p><strong>example</strong></p>
  
  <p>the directory <code>dump</code> has files</p>
  
  <pre><code>a_0509_kasjada.dump
  a_0009_kaoi.dump
  a_0033_msdhaa.dump
  a_0579_qptcla.dump
  </code></pre>
  
  <p>I want to <code>mget</code> only the file name that contains <code>0009</code> pass it as variable.</p>
  
  <pre><code>@ECHO OFF
  TITLE %1 - Get Dumps backup
  
  SET @FileDate=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%%time:~0,2%%time:~3,2%
  
  
  :PING 
  ping    %2   -n 1
  IF %errorlevel% NEQ 0 goto :PING
  
  
  REM --- Check directories existence
  IF NOT EXIST "D:\Backup" MKDIR "D:\Backup" 
  IF NOT EXIST "D:\Backup\%1\" MKDIR "D:\Backup\%1" 
  IF NOT EXIST "D:\Backup\%1\%@FileDate%\" MKDIR "D:\Backup\%1\%@FileDate%"
  
  ECHO open %2&gt; %1_tmp.srjd
  ECHO oracle&gt;&gt; %1_tmp.srjd
  ECHO olAdmin&gt;&gt; %1_tmp.srjd
  ECHO lcd "D:\Backup\%1\%@FileDate%"&gt;&gt; %1_tmp.srjd
  ECHO bin&gt;&gt; %1_tmp.srjd
  
  ECHO mget /home/backup/dump/*.*&gt;&gt; %1_tmp.srjd
  
  ECHO bye&gt;&gt; %1_tmp.srjd
  
  REM --- Launch FTP and pass it the script
  FTP -i -s:%1_tmp.srjd
  
  REM --- Cleanup.
  DEL %1_tmp.srjd
  
  REM --- PAUSE
  EXIT
  </code></pre>