Copying files

Page 1 of 3 123 LastLast

  1. Posts : 14
    Windows 10 on Desktop PC
       #1

    Copying files


    I have a flash drive with many mp3's on it, however they are split up into various folders. How can I copy all mp3's to my fixed disc without the directories, ie just copy the mp3's without having to access each individual directory. TIA, Mike
      My Computer


  2. Posts : 26,399
    Win11 Pro, Win10 Pro N, Win10 Home, Windows 8.1 Pro, Ubuntu
       #2

    Use the wild card option, an example:

    copy C:\UserName\music\*.* D:\backup

    3 Ways to Copy Files in Command Prompt - wikiHow
      My Computers


  3. Posts : 4,176
    Windows 10 Pro x64 Latest RP
       #3

    I think you may be better using this slightly modified command if you do not need to move the folders *.mp3 will only copy the MP3 files Whereas *.* will also copy the folders
    Code:
    copy C:\UserName\music\*.mp3 D:\backup
      My Computers


  4. Posts : 13,701
    Windows10
       #4

    Barman58 said:
    I think you may be better using this slightly modified command if you do not need to move the folders *.mp3 will only copy the MP3 files Whereas *.* will also copy the folders
    Code:
    copy C:\UserName\music\*.mp3 D:\backup
    This is not what OP is asking - OP has mp3 files in many directories and wants to put them all in one directory.
      My Computer


  5. Posts : 4,176
    Windows 10 Pro x64 Latest RP
       #5

    If this does not work you may need to use robocopy ...

    file - ROBOCOPY - Copy folders content to a single folder - Stack Overflow
      My Computers


  6. Posts : 13,701
    Windows10
       #6

    The way I would do it is open a command prompt and type (say usb was d drive)

    d:

    cd \

    dir /s /b *.mp3 > mp3.bat

    Then open mp3.bat in notepad and

    1) replace all "d:" with "copy d:"

    2) replace all ".mp3" with ".mp3 d:\mp3files\*.* (can change drive and path of destination - folder must exist)

    3) save and run batch file

    Just tested above (with pdf files in my case and it worked perfectly.
      My Computer


  7. Posts : 26,399
    Win11 Pro, Win10 Pro N, Win10 Home, Windows 8.1 Pro, Ubuntu
       #7

    cereberus said:
    The way I would do it is open a command prompt and type (say usb was d drive)

    d:

    cd \

    dir /s /b *.mp3 > mp3.bat

    Then open mp3.bat in notepad and

    1) replace all "d:" with "copy d:"

    2) replace all ".mp3" with ".mp3 d:\mp3files\*.* (can change drive and path of destination - folder must exist)

    3) save and run batch file

    Just tested above (with pdf files in my case and it worked perfectly.
    Easiest is just to copy the path in file explorer and paste it in.
      My Computers


  8. Posts : 93
    Windows 10
       #8

    Barman58 said:
    If this does not work you may need to use robocopy
    There’s no switch to stop robocopy from preserving the directory structure. The way to do this in batch is to loop off the results of dir, which can be done directly like so.
    Code:
    for /f "delims=" %%I in (' dir /a:-d /b /s "C:\source\*.mp3" ') do (
        copy "%%~I" "C:\destination\%%~nxI"
    )

    But allow me to advocate for the PowerShell way:
    Code:
    Get-ChildItem 'C:\source' -Include '*.mp3' -Recurse | Copy-Item -Destination 'C:\destination'
      My Computer


  9. Posts : 13,701
    Windows10
       #9

    Pyprohly said:
    But allow me to advocate for the PowerShell way:
    Code:
    Get-ChildItem 'C:\source' -Include '*.mp3' -Recurse | Copy-Item -Destination 'C:\destination'
    Just tried it - failed with all sorts of error messages about permissions when using C drive.
      My Computer


  10. Posts : 93
    Windows 10
       #10

    Try changing the paths and the -Include argument, preferably to something that exists.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 05:06.
Find Us




Windows 10 Forums