![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | copy-item down through folders It seems simple: I just want the equivalent of xcopy /S which copies a full directory tree. copy-item source target -recursive does not give the desired results if a subfolder to be copied already exists in the target tree. In that case, copy-item does not proceed to examine the members of the folder, to copy them. I want the target to be refreshed from the source. How to? THanks, Leo |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: copy-item down through folders That is a bug in Copy-Item. Maybe the function in this post helps: http://groups.google.com/group/micro...A16EB51@xxxxxx -- Kiron |
My System Specs![]() |
| | #3 (permalink) | ||||||||||||
| Guest | Re: copy-item down through folders Leo Tohill wrote:
http://www.bsonposh.com/modules/wordpress/?p=38 It might provide what you want. -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
My System Specs![]() | |||||||||||||
| | #4 (permalink) | ||||||||||||
| Guest | Re: copy-item down through folders Kiron, your solution doesn't address the existence of folders at any depth in the target, does it? "Kiron" wrote:
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #5 (permalink) |
| Guest | Re: copy-item down through folders The function will _copy_ every folder and file of a source folder to a target folder. If the target folder has more folders than the source - at any depth - nothing happens to them, i.e., they'll remain. The function does not synchronize the source and target, just copies everything from the source to the target maintaining the source's structure. -- Kiron |
My System Specs![]() |
| | #6 (permalink) |
| Guest | Re: copy-item down through folders The function will overwrite any existing folder/file - Hidden, ReadOnly - in the target without prompting. The function is equivalent to cmd /c xcopy /e cmd /c xcopy /? . . . /S Copies directories and subdirectories except empty ones. /E Copies directories and subdirectories, including empty ones. . . . -- Kiron |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can the copy-item cmdlet be used to copy public folders to C: ? | JoshGfromPortland | PowerShell | 8 | 06-09-2008 09:03 PM |
| copy-item changing files attributes on network copy failures | jas | PowerShell | 4 | 01-31-2008 12:39 PM |
| Getting Copy-Item to display messages (like the old COPY command in CMD.EXE) ?? | Marc Scheuner | PowerShell | 15 | 10-26-2007 02:41 AM |
| Copy-Item | JW | PowerShell | 4 | 05-03-2007 04:19 PM |
| Copy-Item or Copy-ItemProperty and Remote Registry. | Brandon Shell | PowerShell | 1 | 01-09-2007 10:51 AM |