Google Answers Logo
View Question
 
Q: can't delete file ( Answered,   3 Comments )
Question  
Subject: can't delete file
Category: Computers > Programming
Asked by: bigscooby-ga
List Price: $25.00
Posted: 10 Jan 2003 11:32 PST
Expires: 09 Feb 2003 11:32 PST
Question ID: 141304
win 2000 server.  i have fragmented files that were placed on my
server by an outside source.  these files take up almost the entire
hard drive.  when i click properties they list as 0 kb.  i can't
delete them.  the response i get is  'the directory is not empty.' 
i've set the permissions and tried check disk many times.

Request for Question Clarification by scriptor-ga on 10 Jan 2003 11:38 PST
Dear bigscooby,

Do you have MS-DOS parallel installed on your system? This is highly
recommendable since DOS simply ignores most weird restrictions in
deleting files produced by Windows. Under DOS, you'd be able to force
deletion of many files.

Regards,
Scriptor
Answer  
Subject: Re: can't delete file
Answered By: webadept-ga on 10 Jan 2003 12:06 PST
 
Hi, 

Using the Erase command use the /F switch which will force the removal
of the file.

Here is the help output for the Erase command 

C:\>help erase
Deletes one or more files.

DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
ERASE [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names

  names         Specifies a list of one or more files or directories.
                Wildcards may be used to delete multiple files. If a
                directory is specified, all files within the directory
                will be deleted.

  /P            Prompts for confirmation before deleting each file.
  /F            Force deleting of read-only files.
  /S            Delete specified files from all subdirectories.
  /Q            Quiet mode, do not ask if ok to delete on global
wildcard
  /A            Selects files to delete based on attributes
  attributes    R  Read-only files            S  System files
                H  Hidden files               A  Files ready for
archiving
                -  Prefix meaning not

If Command Extensions are enabled DEL and ERASE change as follows:

The display semantics of the /S switch are reversed in that it shows
you only the files that are deleted, not the ones it could not find.


If this doesn't work, make a file in that directory with notepad or
something simiar and put a single line of text in it, doesn't matter
what it is, i.e "This is a line of text" and save the file as
test.txt. Next copy that file to the offending file name. So if this
0k file of your is called badfile.dat use this command.

C:\ cp test.txt badfile.dat

This will overwrite the file. Then delete the file badfile.dat. 



Thanks, 

webadept-ga

Request for Answer Clarification by bigscooby-ga on 10 Jan 2003 22:34 PST
I should have been clearer in my original post. There is no obvious
way to delete the directory and its contents. That is, we've tried all
the command line commands - such as the ones you suggested prior to
our post here.

I don't think this is answered! The situation is a result of a
break-in to an ftp site where they used our server to store all kinds
of crazy files and directories.

Any other suggestions?

Clarification of Answer by webadept-ga on 10 Jan 2003 23:07 PST
You say it can be moved... do you have a CDROM burner? 

also clarfiy that you tried mtnhike-ga's suggestion below, and what
the results of that was. Please also clarify that you started this
server in safe-mode and could not remove the file then as well, and
that you are using the command line to try these things, not the GUI.

Also, what filesystem are you using on this box, and what is the name
of the directory you are trying to remove (the exact name) and do you
have any free space on the disk at all. If you delete some other file,
temp files or something, do you still not have any room on the disk?

Also, please post the output of 
dir /A 
in total please so I can see what that says. 

Lastly do you have Perl installed on this machine. 

Thanks, 

webadept-ga
Comments  
Subject: Re: can't delete file
From: tomek-ga on 10 Jan 2003 12:56 PST
 
start in safe mode and try to delete it. It worked for me, i had similar problem.
Subject: Re: can't delete file
From: bigscooby-ga on 10 Jan 2003 13:44 PST
 
The directory we're trying to delete is the result of an exploitation
on an ftp site. The security hole has been closed; however we're left
with the directory of files that is extremely deep and large. If we
could just delete this directory we would be okay.

I've tried all suggestions posted thus far with no success.

Some additional information:

The directory can be moved/renamed but not deleted.
The sub-directories cannot be accessed "Permissions".
A new file created in the directory can be deleted.

I hope this clarifies the issue.
Subject: Re: can't delete file
From: mtnhike-ga on 10 Jan 2003 14:22 PST
 
If there is a daemon (NT service) which they started, then there could
be open file locks on those files preventing them to be deleted. 
Likewise, if there's a share on another computer which maps to the
directory on the said computer, then they could have open file locks
on them as well.  If you go into the Start->Settings->Control
Panel->Administrative Tools->Computer Management

and then click on the "Shared Folders" and look into the 'Sessions'
and 'Open Files' items under that level, you can see if this si the
case and right-click to stop/remove.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy