How to delete owner-less 0 byte files from 2008 R2 Server?
We are having in issue since implementing offline files with a Windows Server 2008 R2 server and Windows 7 clients. Occasionally during the sync process there will be errors resulting in a 0 byte file being left on the server. These 0 byte files cannot be moved or deleted, either by the user, the local Server Administrator, or even the Domain Administrator. When trying to view the security on these 0 byte files (as domain admin) I get the message “To continue you must be an administrative user with permission to view this object’s security properties. Do you want to continue?” Continuing brings up the Owner tab, and the current owner shows “Unable to display current owner.” If I try to change the owner to an administrator account I get “Unable to set new owner on <filename>. Access is denied.” I’ve also attempted to take ownership with the command line takeown command (from an elevated command prompt) but get the same “Access is denied.” I’ve also tried command line tools like setacl and icacls to try and manipulate permissions but simply get “Access Denied.” I’ve run chkdsk on the volume but have found no errors. We have several of these 0 byte files that cannot be deleted or manipulated and they are causing sync issues for our offline files users. What can we do to get rid of these?
September 8th, 2010 4:01pm

Hi, If there is error when running takeown from an elevated command prompt, I suspect this error was caused by third party software. Please try to disable all third party software, including antivirus software, Firewall to test. Does the same error occur? If not, you can try to enable the disabled software one by one to find the root cause. Thanks.This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
September 15th, 2010 5:06am

When trying to run takeown from an elevated prompt (logged in as domain admin) it merely comes back "ERROR: Access is denied." I've tried as the server's local admin as well. Both of these accounts have full control rights to the entire file system. This is a dedicated file server and there is nothing at all running on it, except virus software that does not have real-time scanning enabled and I've already disabled that completely for troubleshooting. There is also a remote agent for backup exec, but beyond that there is no third-party software installed. These odd 0 Byte files cannot be opened, renamed, moved, copied, over-written, or deleted. I cannot take ownership of them using any credentials or any of the commonly recommended utilities. Given the folder that they're in and the users involved I'm positive that they're the result of offline-file synchronizations gone wrong, but I cannot get rid of them.
September 16th, 2010 2:01pm

Please try to remove antivirus software and remote agent for backup exec to test. Can you reproduce this error on another server? ThanksThis posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
September 20th, 2010 5:29am

OK. I finally received permission to take this server down and reboot into safe mode, and I was able to delete these files under Safe Mode. Immediate problem solved. I still wish there was a workable alternative to handling this without taking that step. Moving forward I don't want to have to keep taking down a production server to clean up after offline file sync problems. But at least there is a solution of some sort. Thank you for your help.
September 21st, 2010 2:13pm

Was there evr a better solution found to this problem. I am having the same issue - located in redirected folders (Documents, appdata/roaming) that cause offline sync errors and will not delete off the server they are stored on. I have tried using takeown and icalcs commands - but no matter the credentials (Domain Adminstrator, Local Adminstrator, Original User) I get 'access denied' errors. The example I am looking at right now is dropbox.exe located in the user's ...\appdata\roaming\dropbox\bin folder (Windows 7 client, Windows 2008 r2 server, GPO redirecting application Data to server share). User uninstalled dropbox and then started getting offline sysnc errors regarding this file - but I have other examples of these 0kb 'ghost' files that just won't die. Woul love a better workaround than having to reboot into safe mode (which has worked so far).
Free Windows Admin Tool Kit Click here and download it now
January 7th, 2011 5:57pm

Hi! I found a solution using a linux distribution (like ubuntu): - create a mount point (sudo /mnt/tmpshare) - mount the share with this command "sudo mount -t cifs //servername/share /mnt/tmpshare -o username=USERNAME,password=PASSWORD,domain=DOMAIN" (change USERNAME, PASSWORD and DOMAIN with yours) - locate the file and delete it with the command sudo rm -rf FILENAME (or if you want a prompt use rm -i FILENAME) - come back to the home directory (cd) and unmount the share with the command sudo umount /mnt/tmpshare Let me know if you need help. Bye!
January 9th, 2012 9:59am

Hi! We also had big problems with those 0 byte files. But finally I found a solution. You simply have to rename the parent folder and then rename it back. Voilá, the file is deleted. For example: The 0 byte file is located in D:\Folder\File.txt So rename the Folder D:\Folder to D:\Folder2 and then back to D:\Folder Look into D:\Folder and File.txt won't be there. Please let me know if it helps. Thomas
Free Windows Admin Tool Kit Click here and download it now
February 6th, 2012 9:27am

Thanks Thomas. This is a good workaround but what is causing this? I get this at least once a week. We have about 100 users setup with offline files on Windows 7 and Server 2008. We either get 0kb access denied files or we also have users folders trying to sync to someone elses folder. Basically offline files is very very strange.
February 8th, 2012 9:48pm

Thanks Thomas. This is a good workaround but what is causing this? I get this at least once a week. We have about 100 users setup with offline files on Windows 7 and Server 2008. We either get 0kb access denied files or we also have users folders trying to sync to someone elses folder. Basically offline files is very very strange. I'm sorry, I have to disagree. I do NOT think this is a good workaround. Although it might work, it can cause issues. For example..... I'm writing in because I just ran into this issue last night on our main file server running server 2008 R2 WITHOUT SP1. icalcs, setacl, takeown.... nothing.... Now, renaming the parent file isn't an option unless you want to break the shares on the parent folder. Sure, you could export "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares" and then run Thomas' fix and re-import the shares afterwards but I'm looking for an ONLINE fix as my file server hosts thousands of people. This is still not resolved by any stretch of the imagination.
Free Windows Admin Tool Kit Click here and download it now
March 7th, 2012 3:02pm

I had this issue today on a Server 2008 R2 box. Here is how I resolved the issue: Open Server Manager -> Roles -> File Services -> Share and Storage ManagementIn the Action Pane, click Manage Open FilesExpand Open File column then scroll down to find who has the files open In our case a third party application did not properly drop access to the files so I forcefully closed the connection.
April 11th, 2012 4:20pm

Thanks Thomas. This is a good workaround but what is causing this? I get this at least once a week. We have about 100 users setup with offline files on Windows 7 and Server 2008. We either get 0kb access denied files or we also have users folders trying to sync to someone elses folder. Basically offline files is very very strange. I'm sorry, I have to disagree. I do NOT think this is a good workaround. Although it might work, it can cause issues. For example..... I'm writing in because I just ran into this issue last night on our main file server running server 2008 R2 WITHOUT SP1. icalcs, setacl, takeown.... nothing.... Now, renaming the parent file isn't an option unless you want to break the shares on the parent folder. Sure, you could export "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares" and then run Thomas' fix and re-import the shares afterwards but I'm looking for an ONLINE fix as my file server hosts thousands of people. This is still not resolved by any stretch of the imagination. The dos command DEL (which only deletes files) worked for me. I had lots of 0kb files which need to be deleted from old user Home folders. No files were held open by system or user. All file path lengths were well within the maximum. All files remaining in these folders were 0kb files I wanted to delete All files were held in subdirectories of a folder called DATA in E:\SHARES\DATA Log on to the Windows 2008 R2 File server Right-Click Command Prompt and select Run as Administrator! C:\Users\SvrAdmin> E: (Press Enter) E:\> CD SHARES (Press Enter) E:\SHARES> DEL DATA /F /S /Q (Press Enter) This deleted all the remaining files in the folder and subfolders of DATA. I could then delete the folders from within Windows Explorer. You can specificy the full path and file name if you only have specific files you need to delete. Type DEL /? at the command prompt for an explanation of the switches used. This may not work for everyone, but I hope that it helps.
Free Windows Admin Tool Kit Click here and download it now
July 25th, 2012 3:49am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics