Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to delete a zero byte file

Status
Not open for further replies.

dopiaza

IS-IT--Management
Jun 20, 2005
3
GB
Hi,

I'm running W2K SP4 server on a Dell PE2650 with 18GB RAID 1 system partition, In a 'temp' directory under the main user profile I have a file with zero byte size. If I highlight the file, the server locks up (mouse moves, Ctrl-Alt-Del has some effect for 20 secs or so but nothing else). If I run MS defrag, the files shows as being in 1,600,000 fragments (but still zero byte) with half of the drive showing as 'red/fragmented' on the drive map, hence my wish to delete it. When hanging the server shows no drive activity.

I have tried booting to the recovery console using the server installation CD but this just locks up too when I try to delete the file. Any ideas?

Graham
 
Is the file being used by a currently running process?
Can you identify what process may be using the file by it's name?
 
use pskill to shutdown the process and delete that file. it's nothing to do with the size of the file.

------------------------------------
Directory Services/Exchange Consultant
 
Hi Dopiaza,

I came across a similar problem when I found my webserver was hacked a while back. Someone created many many folders all 0 byte as well. I could not remove them no matter what until I found a utility for this. The link as follows:


The program is called Delete FXP files and works excellent. There is a free version that can help you out but you may also want to register if you have a more serious problem with hundreds of folders as I did.

The other alternative as follows:

START | RUN | CMD
CD to your directory.

Use: DIR /X /A to see the SHORT FILE NAMES of the files and directories there.

use:

RMDIR [/Q] [drive:]path
RD [/Q] [drive:]path

/S Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
tree.

/Q Quiet mode, do not ask if ok to remove a directory tree with /S


Hope this helps!

Thanks,

Darryl Brambilla
IT Manager
 
I have also found that a simple:

echo . >> filename.ext

works if the file is not in use. It is then no longer a 0 bytes file and can be deleted.

Mike

*************************************

Remember - There is always another way..........

[yinyang]
 
Kutz32/benlu,

Thanks for your replies, but I don't believe the file is locked by a process as I get the same result when I try to delete from the Recovery Console - also, a locked file would usually just not allow a delete - simply selecting this file by a mouse click hangs the server.

Darryl, Mike

Cheers for the suggestions, I'll give them a go next time I can schedule an outage - but I have the feeling that any attempt at access to the file will lock the system again!

It's a bit of an odd one, chkdsk reports no errors on the disk, so how can it be in over 1.5 million fragments on the drive when it is zero byte? The drive is (fully) backed up daily without any problems using Arcserve backup agent.

Graham



 
Thefile sounds like something an app might be writing (badly) like a lock file or similar.

Not 100% what could be causing it.

As kutz13 asked - What is the filename?

Mike

*************************************

Remember - There is always another way..........

[yinyang]
 
Hi Dopiaza,

Were you able to resolve your problem?

Thanks!

Darryl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top