Using dos to copy files refresher needed

Discussion in 'Computer Support' started by richard, Jan 20, 2008.

  1. richard

    richard Guest

    Been a long time since I used DOS to do anything with.

    I have a huge collection of MP3's that are in hundreds of folders.
    Automated downloader did the saving. { newsbin }.
    What I want to do is to combine all the files within those folders
    into one master folder.

    What's the best way of doing this?
    richard, Jan 20, 2008
    #1
    1. Advertising

  2. richard

    nullity Guest

    "richard" <> wrote in message
    news:...
    > Been a long time since I used DOS to do anything with.
    >
    > I have a huge collection of MP3's that are in hundreds of folders.
    > Automated downloader did the saving. { newsbin }.
    > What I want to do is to combine all the files within those folders
    > into one master folder.
    >
    > What's the best way of doing this?
    >
    >


    Use the xcopy command.
    nullity, Jan 20, 2008
    #2
    1. Advertising

  3. richard

    VanguardLH Guest

    "richard" wrote in message
    news:...
    > Been a long time since I used DOS to do anything with.
    >
    > I have a huge collection of MP3's that are in hundreds of folders.
    > Automated downloader did the saving. { newsbin }.
    > What I want to do is to combine all the files within those folders
    > into one master folder.



    In a DOS shell, run the commands:

    md [destdrive:]destpath
    for /r [srcdrive:]srcpath %i in (*) do copy /y %i [destdrive:]path
    (go delete the srcpath and all subfolders, if wanted)

    destdrive & destpath are the drive and path to where you want to copy
    all the files. srcdrive & srcpath is the starting or parent folder
    under which you want to copies files and walk through its subfolders.
    I added the /y parameter to the 'copy' command to suppress prompting
    in case you have files named the same but in different folders. This
    means they will overwrite each other if you named the files the same.
    If you don't to lose some same-named files, use the 'move' command
    instead (without the /y parameter). Afterward, go back into the
    source folders and rename those files so the above 'for' command works
    without hitting same-named files between destintation and source
    paths.

    Run "for /?" in a DOS shell for help on the 'for' command.
    VanguardLH, Jan 20, 2008
    #3
  4. richard

    richard Guest

    On Sun, 20 Jan 2008 11:18:44 -0600, "VanguardLH"
    <> wrote:

    >"richard" wrote in message
    >news:...
    >> Been a long time since I used DOS to do anything with.
    >>
    >> I have a huge collection of MP3's that are in hundreds of folders.
    >> Automated downloader did the saving. { newsbin }.
    >> What I want to do is to combine all the files within those folders
    >> into one master folder.

    >
    >
    >In a DOS shell, run the commands:
    >
    >md [destdrive:]destpath
    >for /r [srcdrive:]srcpath %i in (*) do copy /y %i [destdrive:]path
    >(go delete the srcpath and all subfolders, if wanted)



    Tried that. All I got was the new folder. Empty.
    Know anything about robocopy? New for vista.


    >
    >destdrive & destpath are the drive and path to where you want to copy
    >all the files. srcdrive & srcpath is the starting or parent folder
    >under which you want to copies files and walk through its subfolders.
    >I added the /y parameter to the 'copy' command to suppress prompting
    >in case you have files named the same but in different folders. This
    >means they will overwrite each other if you named the files the same.
    >If you don't to lose some same-named files, use the 'move' command
    >instead (without the /y parameter). Afterward, go back into the
    >source folders and rename those files so the above 'for' command works
    >without hitting same-named files between destintation and source
    >paths.
    >
    >Run "for /?" in a DOS shell for help on the 'for' command.
    richard, Jan 20, 2008
    #4
  5. richard

    VanguardLH Guest

    "richard" wrote in message
    news:p...
    >
    > "VanguardLH" wrote:
    >>
    >>"richard" ...
    >>>
    >>> Been a long time since I used DOS to do anything with.
    >>>
    >>> I have a huge collection of MP3's that are in hundreds of folders.
    >>> Automated downloader did the saving. { newsbin }.
    >>> What I want to do is to combine all the files within those folders
    >>> into one master folder.

    >>
    >>In a DOS shell, run the commands:
    >>
    >>md [destdrive:]destpath
    >>for /r [srcdrive:]srcpath %i in (*) do copy /y %i [destdrive:]path
    >>(go delete the srcpath and all subfolders, if wanted)

    >
    > Tried that. All I got was the new folder. Empty.
    > Know anything about robocopy? New for vista.


    I just ran "for /r c:\windows %i in (*) do echo %i" in a DOS shell
    just to test the 'for /r' command was correct. It listed all the
    files under every subfolder. So you don't have the correct copy
    command, you forgot to include 'do' between the 'for' and 'copy'
    command, or there were no matching files on the "*" filespec (maybe
    all have the hidden or system file attribute so they won't get
    listed). What happens when you yourself navigate to one of the
    non-empty folders and run the "copy <somefile> [destdrive:]path"
    command? Does the file get copied? See an error message?

    I've used robocopy that comes with the Windows 2000 Resource Kit;
    however, I don't recall using it to merge folders into one folder but
    rather to keep the same folder hierarchy and keep them in sync. Run
    'robocopy /???' on using it. You never mention WHICH version of
    Windows you used plus you asked about a DOS command versus some
    DOS-mode program, so I didn't consider suggesting robocopy or synctoy.
    VanguardLH, Jan 20, 2008
    #5
  6. richard

    VanguardLH Guest

    "nullity" wrote in message
    news:...
    >
    > "richard" wrote ...
    >>
    >> I have a huge collection of MP3's that are in hundreds of folders.
    >> Automated downloader did the saving. { newsbin }.
    >> What I want to do is to combine all the files within those folders
    >> into one master folder.

    >
    > Use the xcopy command.


    So have you tried using 'xcopy' to merge files from multiple
    subfolders into ONE destination folder? What would be the syntax of
    that 'xcopy' command?

    The /s parameter is required to make 'xcopy' walk through each of the
    subfolders. When you add that parameter, what you get at the
    destination folder is the same folder hierarchy that you had in the
    source folder, so "xcopy /s [[srcdrive:]srcpath]\*
    [destdrive:]destpath" results in the same folder hierarchy as found in
    the source path. The OP wants to MERGE all the files in multiple
    subfolders at any level of depth into just one folder. Please explain
    how 'xcopy' can do that?
    VanguardLH, Jan 20, 2008
    #6
  7. richard

    richard Guest

    On Sun, 20 Jan 2008 11:52:51 -0600, "VanguardLH"
    <> wrote:

    >"richard" wrote in message
    >news:p...
    >>
    >> "VanguardLH" wrote:
    >>>
    >>>"richard" ...
    >>>>
    >>>> Been a long time since I used DOS to do anything with.
    >>>>
    >>>> I have a huge collection of MP3's that are in hundreds of folders.
    >>>> Automated downloader did the saving. { newsbin }.
    >>>> What I want to do is to combine all the files within those folders
    >>>> into one master folder.
    >>>
    >>>In a DOS shell, run the commands:
    >>>
    >>>md [destdrive:]destpath
    >>>for /r [srcdrive:]srcpath %i in (*) do copy /y %i [destdrive:]path
    >>>(go delete the srcpath and all subfolders, if wanted)

    >>
    >> Tried that. All I got was the new folder. Empty.
    >> Know anything about robocopy? New for vista.

    >
    >I just ran "for /r c:\windows %i in (*) do echo %i" in a DOS shell
    >just to test the 'for /r' command was correct. It listed all the
    >files under every subfolder. So you don't have the correct copy
    >command, you forgot to include 'do' between the 'for' and 'copy'
    >command, or there were no matching files on the "*" filespec (maybe
    >all have the hidden or system file attribute so they won't get
    >listed). What happens when you yourself navigate to one of the
    >non-empty folders and run the "copy <somefile> [destdrive:]path"
    >command? Does the file get copied? See an error message?
    >
    >I've used robocopy that comes with the Windows 2000 Resource Kit;
    >however, I don't recall using it to merge folders into one folder but
    >rather to keep the same folder hierarchy and keep them in sync. Run
    >'robocopy /???' on using it. You never mention WHICH version of
    >Windows you used plus you asked about a DOS command versus some
    >DOS-mode program, so I didn't consider suggesting robocopy or synctoy.


    You did not clearly identify (*) so I just used it as is.
    So that should actually be something like *.mp3 then?
    richard, Jan 20, 2008
    #7
  8. richard

    chuckcar Guest

    richard <> wrote in
    news::

    > Been a long time since I used DOS to do anything with.
    >
    > I have a huge collection of MP3's that are in hundreds of folders.
    > Automated downloader did the saving. { newsbin }.
    > What I want to do is to combine all the files within those folders
    > into one master folder.
    >
    > What's the best way of doing this?
    >
    >


    Not using dos, but quicker. Open search. Find all files named *.mp3 from
    the top directory recursing down. When it's finished, select all, cut
    and paste into the folder you want them. Then delete the other folders.
    This sort of thing is the reason for Xtree in dos.

    --
    (setq (chuck nil) car(chuck) )
    chuckcar, Jan 20, 2008
    #8
  9. richard

    Guest

    , Jan 20, 2008
    #9
  10. richard

    richard Guest

    On Sun, 20 Jan 2008 19:12:13 +0100 (CET), chuckcar <>
    wrote:

    >richard <> wrote in
    >news::
    >
    >> Been a long time since I used DOS to do anything with.
    >>
    >> I have a huge collection of MP3's that are in hundreds of folders.
    >> Automated downloader did the saving. { newsbin }.
    >> What I want to do is to combine all the files within those folders
    >> into one master folder.
    >>
    >> What's the best way of doing this?
    >>
    >>

    >
    >Not using dos, but quicker. Open search. Find all files named *.mp3 from
    >the top directory recursing down. When it's finished, select all, cut
    >and paste into the folder you want them. Then delete the other folders.
    >This sort of thing is the reason for Xtree in dos.


    <bangs head on wall>
    thanks. works like a charm and probably better.
    richard, Jan 20, 2008
    #10
  11. richard

    meerkat Guest

    "richard" <> wrote in message
    news:...
    > Been a long time since I used DOS to do anything with.
    >
    > I have a huge collection of MP3's that are in hundreds of folders.
    > Automated downloader did the saving. { newsbin }.
    > What I want to do is to combine all the files within those folders
    > into one master folder.
    >
    > What's the best way of doing this?
    >

    Hi Rich, just a personal opinion, but I would`nt put all my
    mp3s in a single folder.
    Group them into folders as you would like them.

    I`ve only got about 3,500 mp3s, but any problems with
    that master folder (corruption etc), and you might lose your
    whole collection.

    bw..
    meerkat, Jan 20, 2008
    #11
  12. richard

    richard Guest

    On Sun, 20 Jan 2008 19:24:59 GMT, "meerkat" <>
    wrote:

    >
    >"richard" <> wrote in message
    >news:...
    >> Been a long time since I used DOS to do anything with.
    >>
    >> I have a huge collection of MP3's that are in hundreds of folders.
    >> Automated downloader did the saving. { newsbin }.
    >> What I want to do is to combine all the files within those folders
    >> into one master folder.
    >>
    >> What's the best way of doing this?
    >>

    >Hi Rich, just a personal opinion, but I would`nt put all my
    >mp3s in a single folder.
    >Group them into folders as you would like them.
    >
    >I`ve only got about 3,500 mp3s, but any problems with
    >that master folder (corruption etc), and you might lose your
    >whole collection.
    >
    >bw..
    >


    I will eventually. But I need them in a single file for the time
    being.
    I'm writing a program that will automate the editing process so I
    don't have to do it by hand. In a single folder makes that easier.
    richard, Jan 20, 2008
    #12
  13. richard

    meerkat Guest

    "richard" <> wrote in message
    news:...
    > On Sun, 20 Jan 2008 19:24:59 GMT, "meerkat" <>
    > wrote:
    >
    >>
    >>"richard" <> wrote in message
    >>news:...
    >>> Been a long time since I used DOS to do anything with.
    >>>
    >>> I have a huge collection of MP3's that are in hundreds of folders.
    >>> Automated downloader did the saving. { newsbin }.
    >>> What I want to do is to combine all the files within those folders
    >>> into one master folder.
    >>>
    >>> What's the best way of doing this?
    >>>

    >>Hi Rich, just a personal opinion, but I would`nt put all my
    >>mp3s in a single folder.
    >>Group them into folders as you would like them.
    >>
    >>I`ve only got about 3,500 mp3s, but any problems with
    >>that master folder (corruption etc), and you might lose your
    >>whole collection.
    >>
    >>bw..
    >>

    >
    > I will eventually. But I need them in a single file for the time
    > being.
    > I'm writing a program that will automate the editing process so I
    > don't have to do it by hand. In a single folder makes that easier.
    >

    Got ya, make sure you keep copies while you play though.
    I`d hate you to lose your collection.

    bw..
    meerkat, Jan 20, 2008
    #13
  14. richard

    VanguardLH Guest

    "richard" wrote in message
    news:...
    >
    > "VanguardLH" wrote:
    >>
    >>"richard" wrote ...
    >>>
    >>> "VanguardLH" wrote:
    >>>>
    >>>>"richard" ...
    >>>>>
    >>>>> Been a long time since I used DOS to do anything with.
    >>>>>
    >>>>> I have a huge collection of MP3's that are in hundreds of
    >>>>> folders.
    >>>>> Automated downloader did the saving. { newsbin }.
    >>>>> What I want to do is to combine all the files within those
    >>>>> folders
    >>>>> into one master folder.
    >>>>
    >>>>In a DOS shell, run the commands:
    >>>>
    >>>>md [destdrive:]destpath
    >>>>for /r [srcdrive:]srcpath %i in (*) do copy /y %i [destdrive:]path
    >>>>(go delete the srcpath and all subfolders, if wanted)
    >>>
    >>> Tried that. All I got was the new folder. Empty.
    >>> Know anything about robocopy? New for vista.

    >>
    >>I just ran "for /r c:\windows %i in (*) do echo %i" in a DOS shell
    >>just to test the 'for /r' command was correct. It listed all the
    >>files under every subfolder. So you don't have the correct copy
    >>command, you forgot to include 'do' between the 'for' and 'copy'
    >>command, or there were no matching files on the "*" filespec (maybe
    >>all have the hidden or system file attribute so they won't get
    >>listed). What happens when you yourself navigate to one of the
    >>non-empty folders and run the "copy <somefile> [destdrive:]path"
    >>command? Does the file get copied? See an error message?
    >>
    >>I've used robocopy that comes with the Windows 2000 Resource Kit;
    >>however, I don't recall using it to merge folders into one folder
    >>but
    >>rather to keep the same folder hierarchy and keep them in sync. Run
    >>'robocopy /???' on using it. You never mention WHICH version of
    >>Windows you used plus you asked about a DOS command versus some
    >>DOS-mode program, so I didn't consider suggesting robocopy or
    >>synctoy.

    >
    > You did not clearly identify (*) so I just used it as is.
    > So that should actually be something like *.mp3 then?



    No, "*" (within the parenthesis) is the filespec on which you want to
    specify the criteria on what files to match. "*", just like in any
    DOS file command, is a wildcard character and means to match on any
    filename. If you ONLY wanted to match on *.mp3 files then you would
    specify that filespec within the parenthesis. I figured you want to
    copy all the files. As each file is matched upon, its filename gets
    put into the %i variable which then gets used in the 'copy' command to
    perform the action on just that file.

    Try running:

    for /r [drive:\]path %i in (*) do echo Filename = %i

    to see what files get matched on by the "*" wildcard filespec. You'll
    have to subtitute [drive:\]path for whatever is the starting or parent
    folder under which you are trying to find files. Are any filenames
    echoed out?
    VanguardLH, Jan 20, 2008
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Don
    Replies:
    5
    Views:
    2,019
    ┬░Mike┬░
    Feb 11, 2004
  2. Richard

    regsvr32 refresher needed

    Richard, Jan 3, 2005, in forum: Computer Support
    Replies:
    1
    Views:
    559
  3. Imhotep

    IPSec tutorial/refresher

    Imhotep, Sep 9, 2005, in forum: Computer Security
    Replies:
    2
    Views:
    4,472
    Imhotep
    Sep 10, 2005
  4. cmerch19602003

    Tab refresher plug-in?

    cmerch19602003, Aug 11, 2006, in forum: Firefox
    Replies:
    1
    Views:
    1,720
    cmerch19602003
    Aug 12, 2006
  5. Replies:
    6
    Views:
    432
    Bucky Breeder
    Nov 20, 2006
Loading...

Share This Page