![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | recursive filterd copy How would I copy all files of a certain type (e.g. *.dll and *.pdb) in a certain directory recursively (i.e. including all subdirectories) to another directoy recursively (i.e. keep the subdirectories). |
My System Specs![]() |
| | #2 (permalink) |
| | RE: recursive filterd copy Existing stand-alone console applications still work well with PS, so robocopy.exe could be the tool of choice for this task: robocopy <sourcefolder> <destinationfolder> *.dll *.pdb /s ---- Gerd "Manage SQL servers using PowerShell?" wrote: Quote: > How would I copy all files of a certain type (e.g. *.dll and *.pdb) in a > certain directory recursively (i.e. including all subdirectories) to another > directoy recursively (i.e. keep the subdirectories). |
My System Specs![]() |
| | #3 (permalink) |
| | Re: recursive filterd copy $source="C:\temp" $destination="D:\copyTest" get-childitem -recurse -path $source -include *.dll,*.pdb | foreach { $dir = $destination + (split-path $_.DirectoryName -NoQualifier) New-Item $dir -itemtype directory -force copy-item $_-destination $dir } ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Quote: > How would I copy all files of a certain type (e.g. *.dll and *.pdb) in > a certain directory recursively (i.e. including all subdirectories) to > another directoy recursively (i.e. keep the subdirectories). > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: recursive filterd copy $src = 'C:\SourceDir' $dest = 'C:\DestinationDir' $fTypes = '*.dll', '*.pdb' ls $src -i $fTypes -r | % { $file = $_.fullname $new = $file -replace [regex]::escape($src), $dest trap [System.IO.DirectoryNotFoundException] { [void](md $(split-path $new -par)) cpi $file $new continue } cpi $file $new } -- Kiron |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| recursive directory search | VB Script | |||
| Workaround to MS recursive paremeter bug | PowerShell | |||
| Recursive delete slow | PowerShell | |||
| Recursive directory size in O(1) | Vista file management | |||
| Recursive directory size in O(1) | Vista file management | |||