Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I was copying files from linux to windows (via COPSSH) using a command like (from linux shell):

scp -pr dir administrator@win:/cygdrive/c/dest/

(dir was a directory with files and subdirectories)

Transfer was interrupted by pressing ctrl-c (from linux shell). I was able to delete all the files copied to windows except the one which transfer was interrupted on and (sub)directories in which it resides.

How can I delete this file?

In security settings of this file as current owner is "Unable to display current owner". I tried (of course as administrator) to change ownership of this file to administrator, but always got "Access is denied". I also tried this as SvcCOPSSH user (copSSH service account) and as sshd (copSSH privilege separation user) but that as well didn't succeed. That command didn't do the job either:

takeown /F file /A

Is there a solution to this?

share|improve this question
    
What version of Windows? –  user165568 Feb 27 '13 at 23:35
add comment

1 Answer

up vote 0 down vote accepted

Go to Administrative Tools, Computer Management, System Tools, Shared Folders, Open Files. Close the open file connection.

Or reboot Windows. If there is an existing connection, shut-down will close it.

Or leave it for a while. If there is no connection, or if the connection is using BITs, the open file will timeout after a while.

Does SCP use Background Intelligent Transfer? (Unlikely). If so, use BITSadmin.

share|improve this answer
    
I was able to delete this file after rebooting Windows. As far as I can tell it was caused by some process keeping file handles opened just as it was pointed out here: serverfault.com/questions/9302/… –  user162185 Mar 4 '13 at 23:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.