Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - copy-item over write help!

Reply
 
Old 09-23-2009   #1 (permalink)
scale


 
 

copy-item over write help!

copy-item "source path" -destination "\\network\path " -recurse -force -verbose


Here is my question
This works great the first time you run it. It copies all info from the
source to the destination network UNC path just fine.

The next time you run it....it runs fine but the date stamps on the
destination file and folders are not changed so i have no way of knowing if
it is actually overwriting the files or not. I want it to overwrite the
destination every time i run this....not look at it and skip the files that
are there.

How can i tell if it is actually overwriting the exisiting destination files
if the date is not changed?


If an overwrite is not possible with the copy-item command....
what command can i run do delete the destination folder structure just prior
to running my copy-item command in powershell? That might also be an option
for me.

The bottom line is a need a way to copy files from location A to location B.
Overwrite what is in location B every time the command is run.

Seems simple but like i said.....it seems to be not overwriting it if it
exists...but skipping the files even though i have the -force switch. THe
files are huge and the command acts like it is working properly as there is a
time delay like it is actually copying somthing...but the dates and times do
not update on the destination files.

weird indeed.

Anyone have any suggestions?

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Copy-Item : Container cannot be copied onto existing leaf item. PowerShell
Can the copy-item cmdlet be used to copy public folders to C: ? PowerShell
copy-item changing files attributes on network copy failures PowerShell
Getting Copy-Item to display messages (like the old COPY command in CMD.EXE) ?? PowerShell
Write-Progess of Copy-Item PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46