Drush error when attempting Drupal update: unable to copy/move I have a Drupal site running on localhost (Windows) that I'm trying to update from 8.6.7 to 8.6.15.

When using Drush to perform the update (drush up drupal -y), I encounter the following error:

Unable to copy C:\Users\USERNA~2\AppData\Local\Temp/drush_tmp_1556533742_5cc6d1ee1cacf/drupal-8.6.15 to
W:\htdocs\site-name\www/drupal-8.6.15.
Unable to move C:\Users\USERNA~2\AppData\Local\Temp/drush_tmp_1556533742_5cc6d1ee1cacf/drupal-8.6.15 to
W:\htdocs\site-name\www/drupal-8.6.15.
Updating project drupal failed. Attempting to roll back to previously installed version.
Backups were restored successfully.


I've tried:


clearing Drush's cache (drush cc drush)
updating Drush (via composer) (now running Drush 8.2.3)
clearing Drupal's caches


But the problem remains.

This problem does NOT occur when updating modules. Only Drupal itself.

I checked the C:\Users\USERNA~2\AppData\Local\Temp folder while drush was working, and I was able to confirm that the drush_tmp_1556533742_5cc6d1ee1cacf subfolder was indeed present for a time (containing the Drupal .tar.gz and its upacked folder). So there's no issue in writing in this folder.

Any idea what causes this and how to solve it?

Thanks in advance.
We can only guess at an answer. A likely scenario might be disk space, permissions, or some other conflict with Drush &amp; filesystem, but that's speculation. 

Run the same command with the --debug flag (drush up drupal -y --debug) to see a verbose dump of what Drush is doing and look for errors/warnings that occur as Drush is attempting a core update. Once you know the underlying filesystem issue you'll be able to resolve it.