+ Post New Thread
Results 1 to 4 of 4
Windows Thread, copy only certain file types between folders.. in Technical; I have two folders A & B both contain many sub-folders, each sub-folder contains many sub-folders. each subfolder contains a ...
  1. #1
    kennysarmy's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    1,401
    Thank Post
    93
    Thanked 48 Times in 34 Posts
    Rep Power
    31

    copy only certain file types between folders..

    I have two folders

    A & B

    both contain many sub-folders, each sub-folder contains many sub-folders.

    each subfolder contains a mixture of html files and txt files.


    How can I duplicate the contents of folder A to B but NOT over write any html files that exist with the same name, but ensure ALL txt files ARE over-written?

    Hope that is clear

    Kenny

  2. #2
    somabc's Avatar
    Join Date
    Oct 2007
    Location
    London
    Posts
    2,337
    Thank Post
    83
    Thanked 388 Times in 258 Posts
    Rep Power
    112
    Why dont you search on A for *.txt and copy only txt files to B

  3. #3
    Bezwick's Avatar
    Join Date
    Feb 2008
    Location
    Nottinghamshire
    Posts
    367
    Thank Post
    94
    Thanked 60 Times in 45 Posts
    Rep Power
    26
    how about a line something along these lines

    xcopy <source>\*.txt <destination>\*.txt /s /c /i /f /y

    Should work or some variation of it. i think




    Quote Originally Posted by kennysarmy View Post
    I have two folders

    A & B

    both contain many sub-folders, each sub-folder contains many sub-folders.

    each subfolder contains a mixture of html files and txt files.


    How can I duplicate the contents of folder A to B but NOT over write any html files that exist with the same name, but ensure ALL txt files ARE over-written?

    Hope that is clear

    Kenny

  4. #4
    kennysarmy's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    1,401
    Thank Post
    93
    Thanked 48 Times in 34 Posts
    Rep Power
    31
    Quote Originally Posted by jinnantonnix View Post
    You can use good old robocopy with the /XF filters on the end (e.g. /XF *.html and so on)

    The XF excludes files that match the specified filespec.


    OR you could just specify you want to copy the .txt files by putting *.txt at the end of the robocopy command.

    Either way... Robocopy
    I used a variant called RichCopy which worked a treat - many thanks.



SHARE:
+ Post New Thread

Similar Threads

  1. Mass Copy of Files and Folders
    By originofsymmetry in forum Scripts
    Replies: 6
    Last Post: 2nd October 2007, 01:16 PM
  2. Windows Media Services File Types?
    By dagza in forum Windows
    Replies: 1
    Last Post: 23rd May 2007, 10:52 AM
  3. Copy a file to many destination folders.
    By fooby in forum Windows
    Replies: 1
    Last Post: 14th June 2006, 03:18 PM
  4. Replies: 4
    Last Post: 23rd March 2006, 07:27 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •