Created
          September 14, 2020 15:02 
        
      - 
      
 - 
        
Save jimdiroffii/b36540e851d38bb1fdb03ac27b8edde9 to your computer and use it in GitHub Desktop.  
    Copy files of a certain type
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | for /R %%x in (*.jpg,*.png) do copy "%%x" C:\<targetdir> | 
Alternative, retains subfolder structure: xcopy /s foo\myfolder\*.txt moo\myfolder
Alternative, copy files only, without subfolders: Get-ChildItem $source -Recurse | Where-Object { $_.PSIsContained -eq $False } | ForEach-Object {Copy-Item -Path $_.Fullname -Destination $dest -Force}
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
Alternative, retains subfolder structure:
robocopy <searchfolder> <newfolder> /S /COPYALL *.<type>