title: Windows command/commands to FIND file and COPY it to certain location or directory where batch file was launched from
body: <p>So, I have started with this:</p>
  
  <pre><code>copy | dir /s /b | find "myFile" C:\Destination
  </code></pre>
  
  <p>but the problem is that the destination is not visible in this command. It only sees the first part of the command up until C:\Destination.</p>
  
  <p>Is there a way I can search for a file and copy it?</p>
  
  <p>I have also tried this:</p>
  
  <pre><code>SET source = dir /s /b | find "myFile"
  SET destination = %CD%
  copy %file% %destination%
  </code></pre>
  
  <p>but it doesn't work.</p>
  
  <p>At some point even trying to set a variable that points to the current directory (<code>%CD%</code>) doesn't work.</p>
  
  <p>Thanks in advance!</p>
  
  <p>PS: I'm looking for a solution that would work without installing anything new on the computer, that's why I'm thinking of batch files.</p>
  
  <p>I think I could do this with VBscript but I'm not sure. If anyone thinks it's a better option please post that answer too.</p>