![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | copy-item changing files attributes on network copy failures I came across very strange behaviour in copy-item today. When copying a read-only file repeatedly from the network to a local folder the first copy works but the second copy fails, however the third copy works. The exact same copy-item test using local C: paths works fine. Has anyone else seen this behaviour before? The example below shows the attribute change after the failed copy. PS>gci \\myserver\share\testfile.exe Directory: Microsoft.PowerShell.Core\FileSystem::\\myserver\share\testfile.exe Mode LastWriteTime Length Name ---- ------------- ------ ---- -ar-- 17/01/2008 07:45 270336 testfile.exe PS>1..10 | %{copy-item "\\myserver\share\testfile.exe" . -force ; gci} Directory: Microsoft.PowerShell.Core\FileSystem::C:\Documents and Settings\jas Mode LastWriteTime Length Name ---- ------------- ------ ---- -ar-- 17/01/2008 07:45 270336 testfile.exe Copy-Item : The file 'C:\DOCUME~1\jas\testfile.exe' already exists. At line:1 char:20 + 1..10 | %{copy-item <<<< "\\myserver\share\testfile.exe" . -force ; gci} -a--- 17/01/2008 07:45 270336 testfile.exe -ar-- 17/01/2008 07:45 270336 testfile.exe Copy-Item : The file 'C:\DOCUME~1\jas\testfile.exe' already exists. At line:1 char:20 + 1..10 | %{copy-item <<<< "\\myserver\share\testfile.exe" . -force ; gci} -a--- 17/01/2008 07:45 270336 testfile.exe -ar-- 17/01/2008 07:45 270336 testfile.exe Copy-Item : The file 'C:\DOCUME~1\jas\testfile.exe' already exists. At line:1 char:20 + 1..10 | %{copy-item <<<< "\\myserver\share\testfile.exe" . -force ; gci} -a--- 17/01/2008 07:45 270336 testfile.exe -ar-- 17/01/2008 07:45 270336 testfile.exe Copy-Item : The file 'C:\DOCUME~1\jas\testfile.exe' already exists. At line:1 char:20 + 1..10 | %{copy-item <<<< "\\myserver\share\testfile.exe" . -force ; gci} -a--- 17/01/2008 07:45 270336 testfile.exe -ar-- 17/01/2008 07:45 270336 testfile.exe Copy-Item : The file 'C:\DOCUME~1\jas\testfile.exe' already exists. At line:1 char:20 + 1..10 | %{copy-item <<<< "\\myserver\share\testfile.exe" . -force ; gci} -a--- 17/01/2008 07:45 270336 testfile.exe |
My System Specs![]() |
| | #2 (permalink) |
| | Re: copy-item changing files attributes on network copy failures jas wrote: Quote: > I came across very strange behaviour in copy-item today. When copying a > read-only file repeatedly from the network to a local folder the first > copy works but the second copy fails, however the third copy works. The > exact same copy-item test using local C: paths works fine. Has anyone > else seen this behaviour before? -seconds XX on each run if I see the same failures. Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com |
My System Specs![]() |
| | #3 (permalink) |
| | Re: copy-item changing files attributes on network copy failures jas wrote: Quote: > I came across very strange behaviour in copy-item today. When copying a > read-only file repeatedly from the network to a local folder the first > copy works but the second copy fails, however the third copy works. The > exact same copy-item test using local C: paths works fine. Has anyone > else seen this behaviour before? I tested this with the v2 CTP, and could not reproduce. I'm sorry, but I can't try v1 right now, but perhaps someone else can help out. Marco -- 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) |
| | Re: copy-item changing files attributes on network copy failures Thak you for looking, I have the opisite problem and cannot test with the CTP version. "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com> wrote in message news:u1Q6JDBZIHA.4828@xxxxxx Quote: > jas wrote: Quote: >> I came across very strange behaviour in copy-item today. When copying a >> read-only file repeatedly from the network to a local folder the first >> copy works but the second copy fails, however the third copy works. The >> exact same copy-item test using local C: paths works fine. Has anyone >> else seen this behaviour before? > > I tested this with the v2 CTP, and could not reproduce. I'm sorry, but I > can't try v1 right now, but perhaps someone else can help out. > > Marco > > -- > Microsoft MVP - Windows PowerShell > http://www.microsoft.com/mvp > > PowerGadgets MVP > http://www.powergadgets.com/mvp > > Blog: > http://marcoshaw.blogspot.com |
My System Specs![]() |
| | #5 (permalink) |
| | Re: copy-item changing files attributes on network copy failures jas wrote: Quote: > Thak you for looking, I have the opisite problem and cannot test with > the CTP version. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| bug in copy-item of readonly files | PowerShell | |||
| Can the copy-item cmdlet be used to copy public folders to C: ? | PowerShell | |||
| Getting Copy-Item to display messages (like the old COPY command in CMD.EXE) ?? | PowerShell | |||
| copy files with AD attributes in name?? | PowerShell | |||
| Copy-Item or Copy-ItemProperty and Remote Registry. | PowerShell | |||