Link to home
Start Free TrialLog in
Avatar of Scott Borison
Scott BorisonFlag for United States of America

asked on

Can't Delete a Folder in Server 2008 R2

I have a folder on my server (C:\users\XYZ\AppData\Local\Microsoft\Windows) that shows as over 150 GB in properties. I have deleted the original user and renamed the user files so that I can work this at my leisure -- except that I'm low on disk space.

I have tried deleting all the visible and hidden directories and items under the folder, but it still shows the same huge size under properties. I've tried rmdir xyz /s from the Users directory but it just runs and runs, using from zero to 3% of cpu without deleting. I've tried right-click -> delete but it just runs and runs without deleting (or even saying too big for recycle bin).

I note that the folder has a read only attribute; i tried clearing read only and apply but stopped it when I saw there were 11 hours to go, suspecting i could create other problems.

My next step would be chkdsk /r overnight although i'm a little wary of running it remote, as i am.

For typical users the corresponding file is under a gig.

What do you think?
Avatar of pjam
pjam
Flag of United States of America image

I would try "Unlocker".
http://en.wikipedia.org/wiki/Unlocker
Major Geeks has a May version at:
http://www.majorgeeks.com/files/details/unlocker.html
Avatar of Michael Dyer
it might be a hidden file that is causing the issue.  Look in folder options and make sure it is set up to show hidden files folders and drives and then see if you can find the file that is preventing you from deleting this folder
Stop the windows search service and then delete the user profile.

also check for the D:\Users\Administrator\AppData\Local\Microsoft\Windows\WER location take ownership and then delete the content of this folder.
Avatar of Scott Borison

ASKER

Yes, i did show hidden folders. The offending folder is empty in Windows Explorer of all files, hidden and otherwise. I'll check unlocker later today.  Thank you! Also, I'm letting delete run. It still shows 'recycling' after several hours. However, physical disk time is running around 100% (and slowing down users).
SOLUTION
Avatar of Pradeep Dubey
Pradeep Dubey
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I deleted the user's SID in the registry under HKEY_Local_MACHINE\SOFTWARE\Microsoft\WindowsNT\Current Version\ProfileList. Then I renamed the profile under users (to XYZ). Then the user logged back in without incident.
use the treesize to find out where the space is utilized and then you will be able to do anything once you know where the space is used.

https://www.jam-software.de/customers/downloadTrial.php?article_no=101&language=EN&PHPSESSID=aoen6gnl1ndgpc761b9n50pse6
Treesize hangs with an hourglass at C:\users\XYZ\AppData\Local\Microsoft\Windows\TemporaryInternetFiles\Content.IE5\115X4DHX and takes 100% disk time, vs maybe 5% average if it's not running. Content.IE5 and 115X4DHX both show as 0.0 MB. Total showing for user XYZ is 542 MB.  

If i run properties in explorer on xyz, I get over 150 gigs.

Go figure...
Wait for some time you will get the output of the tree size.
Treesize has been running for a couple hours now, hung in the same way. it ran right up to 173 GB on my C: drive in the first few minutes, with hour glass on suspect file. it's using 100% CPU. Windows says 398 GB on C drive. I'm thinking there's some really messed up directory that needs fixing.

Meanwhile, an Acronis backup from last week is 141 GB, which would seem about right with compression.

Is it likely chkdsk /r would fix such a corrupted directory, if corruption is indeed the problem?
You would probably want to run chkdsk /f /r.  If you run this while the server is running, you will see the following message:  

Chkdsk cannot run because the volume is in use by another process. Would you like to schedule this volume to be checked the next time the system restarts? (Y/N)

Type Y, and then press ENTER to schedule the disk check, and then restart your computer to start the disk check.

Here is more information on chkdsk and the command line switches:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/chkdsk.mspx?mfr=true
WAIT ....

Do not run CHKDSK /F /R until you really need it.

First of all run chkdsk in read only and see if it is reporting any issue.

If Yes then only run the chkdsk /f and reboot.

/f /r may be dangerous to your live server. so before taking backup do not run it.

Tree size will get back to you what is in that folder some times it take much time but not too much.
So i request you to close this and run again when load on server is low.
I ran CHKDSK over night already -- and it's still running but i think stuck.I really want to interrupt it, but understand there are risks.
Did you rebooted the machine recently ? If not please reboot once, a reboot may fix all the issue.
I will have to interrupt CHKDSK /F /R. I'd do that by simply pressing reset on the server. My understanding is that the 'dirty' bit will be set and it will go right back into CHKDSK. I have the original install disk and/or i have a suitable backup, so chances of losing the server altogether are minimal. Even so, i'm reminded that being in a hurry is not good!
Dont just cancel chkdsk /f /r, if server is running then clear it from the registry see below key which has this chkdsk info which will start before loading the OS.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager

Open in new window


In the right hand pane, double click BootExecute.
The default value of the key is autocheck autochk *
* means every drive is checked for consistency. Just add /K:C at the end before *. /K switch will disable autocheck on C: drive at Windows startup. So the final value should look like this:
autocheck autochk /k:C *
If you want to add more drives, the key should look like this: (disabling C and D drives)
autocheck autochk /k:C /k:D *
If you want to restore everything to default, just replace the key with the default one i.e.
autocheck autochk *


http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/how-to-disable-the-chkdsk-check-disk-on-start-up/35f58c69-7a6c-4e1b-aec3-26d7131ec643
Server is not running. CHKDSK is running on boot drive, C:\  I don't think there's a way to kill it other than reset.
Yes, no other option. But I strongly recommend do not reset machine let the chkdsk run.
Major disk corruption may happen.
Chkdsk ran to completion after 24+ hours and the server booted without incident. However, the original issue is unchanged from the start of this post; the offending folder shows as empty in explorer, yet properties of the folder show 202 Gigs and over 9 M files! I'll let this be until the weekend.
Let the tree size run on the machine.

also I would like to suggest take ownership of this folder and then delete it.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
As suggested, I ran Treesize to conclusion, which took 7 hours. Right click on the problem folder caused Treesize to crash. Then I ran rmdir /s /q xyz as administrator. In 20 hours of run time at 100% disk access it increased my free space from 35 GB to 208. There's more to go but I was forced to log off. So, the files can be deleted given enough time. Where they came from remains a mystery.
In retrospect, deleting or running del or rmdir from a command prompt was the simple solution. What I didn't get is that any of them could run a long, long time. However, by monitoring free space on C: I could see it increasing although only at around 10 G per hour.