Jump to content

can't delete file that wrongly attributed as Directory


Joseph_sw

Recommended Posts

OS: WinXp Pro (x86)

FileSystem: NTFS

Heres the problem:

C:\Documents and Settings\user\Cookies>DIR /ad
Volume in drive C has no label.
Volume Serial Number is BAD5-F00D

Directory of C:\Documents and Settings\user\Cookies

07/12/2012 12:49 PM <DIR> .
07/12/2012 12:49 PM <DIR> ..
01/01/1601 08:00 AM <DIR> user@emu-russia.net
0 File(s) 287 bytes
3 Dir(s) 91,679,412,224 bytes free

C:\Documents and Settings\user\Cookies>CD user@emu-russia.net
The directory name is invalid.

C:\Documents and Settings\user\Cookies>rd user@emu-russia.net
The directory name is invalid.

C:\Documents and Settings\user\Cookies>TYPE user@emu-russia.net
__utma
158673838.1062010208.1303442707.1308372659.1308768671.4
emu-russia.net/
1600
25463774
30305968
2797722368
30159117
97__utmz
1586738*
.1303442707.1.38utmcsr=google|1.mccn=(organic)uttmcmd=organic||umctr=emu%20rus a
emu-russia.nsi/
1600
2623862et6
30183429
3760160064
30146716
*

C:\Documents and Settings\user\Cookies>del user@emu-russia.net
The directory name is invalid.

as you see, the info about 287 bytes when specify /ad switch is weird.

i tried the 'CD' 'DEL' or 'RD' its all failed,

its even more weird that the 'TYPE' command actually works.

so, i suspect that file 'user@emu-russia.net' is actualy a cookie file that wrongly attributed as <DIR>.

i've tried the following:

  • using CHKDSK C: /F, reboot and let the chkdsk completed. But i still unable to delete that file
  • i try clearing cookies from IE, the other cookies were deleted but that file remains there.
  • i'm unable to open that file using notepad or other apps.
  • Somehow i able to rename that file, but i still unable to delete it

I don't know how that happened, i just want to rid it.

Link to comment
Share on other sites


Maybe this ...

attrib -r -a -s -h "C:\Documents and Settings\user\Cookies\user@emu-russia.net" /d

rd /s "C:\Documents and Settings\user\Cookies\user@emu-russia.net"

Don't forget those quotes, they are critical.

My backup plan would be to just use the NTFS version of Directory Snoop (not free but it has a free trial).

EDIT: updated image URL, and again

Edited by CharlotteTheHarlot
Link to comment
Share on other sites

Glad it is fixed. Before I saw your reply I did some searching and quickly found out that no combination of search terms in Google would help. Not that the problem is unprecedented (I think I have heard of this happening before) but there seems to be no way to phrase it in Google-ease to exclude the 75 billion hits discussing basic ATTRIB questions.

Also, from some of those hits I was reminded that there are some bugs in ATTRIB not present in Win9x. For example wiki says ...

Particularities

In certain versions, when both the s and h attributes are both set, they can only be removed at the same time. Therefore, to remove only one, both must first be removed, and then the desired attribute can be (re)set, for example

C:\> attrib -S -H *.*

The command will not clear the Read-Only flag from hidden files and will report that the flag was not cleared on each file.

NOTE: I believe they are saying that *if* the -R were present in the example then it would not clear the R attribute.

This suggests that success or failure of an ATTRIB command completely depends on the initial state of the file attributes. A file with +S+R or +H+R apparently will not have the same result as +S+H+R and so on.

The way I read it is that the net effect of that bug means that on WinXP+ you must decouple S and H from any other ATTRIB command and do them first. What a mess!

Anyway, that command I mentioned in my earlier comment probably should have been more like this ...

attrib -s -h "C:\Documents and Settings\user\Cookies\user@emu-russia.net" /d

attrib -r -a "C:\Documents and Settings\user\Cookies\user@emu-russia.net" /d

rd /s "C:\Documents and Settings\user\Cookies\user@emu-russia.net"

Also, there is another switch I forgot about: /L which deals with symbolic links so I wonder if there is a possibility that you were looking at a pointer. Probably the smart thing is to first get a list of any NTFS aliases by using Nirsoft NtfsLinksView (it's free!).

ba5YPJA.gif

I usually use this myself beforehand on every disk I need to work with. Just aim it at X:\ (the root folder of whatever drive letter) and let it completely scan and save the output to a text file. There is quite a mess of aliases these days with Vista and Win7.

EDIT: updated image URL, and again

Edited by CharlotteTheHarlot
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...