kennysarmy Posted April 2, 2009 Posted April 2, 2009 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
somabc Posted April 2, 2009 Posted April 2, 2009 Why dont you search on A for *.txt and copy only txt files to B
Bezwick Posted April 2, 2009 Posted April 2, 2009 how about a line something along these lines xcopy \*.txt \*.txt /s /c /i /f /y Should work or some variation of it. i think 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
kennysarmy Posted April 2, 2009 Author Posted April 2, 2009 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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now