![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | Bug in copying file shares? If I try to copy a folder share then it creates a new directory one level lower than I expected. In this example, I want to copy the contents into ".../SysInternals" but it creates ".../SysInternals/Tools" instead. PS C:\> copy-item "\\live.sysinternals.com\Tools" -destination "C:\Program Files\SysInternals" -recurse -force -whatIf What if: Performing operation "Copy Directory" on Target "Item: \\live.sysinternals.com\Tools Destination: C:\Program Fi les\SysInternals\Tools". If I try again using a sub folder of the file share, then it works as I expected: PS C:\> copy-item "\\live.sysinternals.com\Tools\WindowsInternals" -destination "C:\Program Files\SysInternals" -recurse -force -whatIf What if: Performing operation "Copy Directory" on Target "Item: \\live.sysinternals.com\Tools\WindowsInternals Destinati on: C:\Program Files\SysInternals\WindowsInternals". Is this a bug or am I missing something? And either way, is there an easy way to get the effect I'm after? -- Jonathan Allen |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Bug in copying file shares? Here is an old thread that explains this bug/feature and the function 'xCopy' --now renamed 'ezCopy'-- was introduced: http://groups.google.com/group/micro...9b8b4424c2af22 # ezCopy checks for the presence of the # destination folder and proceeds accordingly function ezCopy ( [string]$src = $(throw 'Specify the source directory'), [string]$dest = $(throw 'Specify the destination diirectory') ) { $src = $src -replace '\*$' if (test-path $dest) { switch -regex ($src) { '\\$' {$src = "$src*"; break} '\w$' {$src = "$src\*"; break} default {break} } } copy-item $src $dest -recurse -force } # then... ezCopy \\live.sysinternals.com\Tools 'C:\Program Files\SysInternals' -- Kiron |
My System Specs![]() |
| | #3 (permalink) |
| | RE: Bug in copying file shares? How about PS C:\> copy-item "\\live.sysinternals.com\Tools\*" "C:\Program Files\SysInternals" -recurse -force -whatif Does that work? |
My System Specs![]() |
| | #4 (permalink) |
| | RE: Bug in copying file shares? When I used *.* it didn't get sub-directories even though I specified -recurse. If I think of it I will try just * tomorrow. -- Jonathan Allen "Mohan Gupta" wrote: Quote: > How about > > > PS C:\> copy-item "\\live.sysinternals.com\Tools\*" "C:\Program > Files\SysInternals" -recurse -force -whatif > > Does that work? |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| One resolution to Slow Vista copying times from network shares | Vista networking & sharing | |||
| VPN connects, but no file shares | Vista networking & sharing | |||
| VPN connects, but no file shares | Vista networking & sharing | |||
| WMDC Changes File Date When copying file to Laptop | Vista General | |||
| Copying on network shares stutters Vista | Vista networking & sharing | |||