# Dos



## JohnTruckMan (Nov 19, 2002)

How do you clear or delete all files on hard drive? I have an old computer to dispose of and I want to delete everything on hard drive.


----------



## cpuhack.com (Apr 25, 2002)

Steps to relatively safely clear a drive with DOS...

First, create a boot disk (many folks post "toolkit bootdisks" on the web).

Then, boot from the boot disk and use FORMAT x:
(replace x: with the drive you want to format)

After that, use FDISK to delete all partitions on that drive.

You'll have a basically zeroed out drive. If it contains *really* private data that you don't want any forensic tools to recover...I'd be happy to zero it for you for a small fee. ;-)


----------



## MacFromOK (Mar 19, 2001)

_______________________________________________
Here's another method... 

From a DOS boot disk, you can type:

*deltree /y c:\*.**

and press ENTER.

This should delete all files and folders on the C drive,
and won't require the next user to fdisk and format.
It must be done for each drive on the machine.
You can type *dir c:\* and press ENTER to check files,
directories (folders) and free space remaining.

To prevent *deleted* information from being recovered,
you can use a batch file to zero the writable area of
each drive. It simply writes zeros to a text file until it
runs out of disk space. Again, this must be done for
each drive.

Copy this and save it as a text file named "zero.bat".
Type *zero* and press ENTER to start it. It does
NOT overwrite existing files, it simply fills up all free
space with zeroes which prevents data recovery.

```
:START
echo 0000000000 >> c:\zero.txt
goto START
```
You can stop the batch file by pressing *CNTRL+C*
and then *Y* when it offers to terminate. This is
really slow, so you'd prolly want to stop it occasionally
and type *dir c:\* (and press ENTER) to check free
space (bytes) left and the size of the file "zero.txt".

This example should eventually zero the drive within 9
bytes. If 1-9 characters remaining isn't close enough,
remove all the zeroes in the batch file except one, and
run it again.

When there's no free space left, delete zero.txt.

The process would be considerably faster by using 100
zeroes in the batch file first. Then when it can't write
anymore, run the batch file again with a single zero
to fill in the remaining space (which would be less than
100 bytes). Do NOT use more than 100 zeroes in the
batch file, or you may overload the DOS command line
buffer (usually 128 chars). 

Cheers, Mac


----------



## cpuhack.com (Apr 25, 2002)

Interesting suggestions...same way of getting things done I spose...can't fathom how long that might take though! ;-)

Best,

cpuhack.com


----------



## Rockn (Jul 29, 2001)

That won't write all zeros to the hard drive!! It is only writing and appending zeros to a text file on the hatd drive. Basically all you are doing is increasing the size of the zero.txt file until the hard drive is full. To write all zeros you can use a debug routine or get a low level format utility to do it. There are also apps like BCWipe, but they are not free.


----------



## MacFromOK (Mar 19, 2001)

______________________________________________
Uh... I don't see the problem here... 

Yes, it writes zeroes to a text file - but this basically
*overwrites* the space where any *deleted* files may
still reside.

If you think it's ineffective, try recovering previously
deleted data after running it... 

Cheers, Mac


----------



## cpuhack.com (Apr 25, 2002)

I think it's a very novel suggestion!  I agree that it will be very effective to clear off data for transferring the machine to a new owner. Now, if you have some quasi-government agency trying to peak at your NASA work-from-home stuff, it might be best to do a sector zero as rock'n suggests.


----------



## MacFromOK (Mar 19, 2001)

_______________________________________________
Well, I have heard the FBI can read files that have
been overwritten several times, because there is a
faint magnetic image left on the media even if over-
written with a new file. If this is true, then data can
only be destroyed by smashing the hard drive with a
hammer, or overwriting multiple times (and who knows
how many times is effective?).

My point is this... It really doesn't matter if every *bit*
(8 per *byte*) is a zero, or if every 8 *bits* are used to
make a zero *byte* character (such as in a text file).
If the file is overwritten, it's overwritten - period.

If your data is sensitive enough to interest the FBI,
I'd recommend the hammer approach... 

Cheers, Mac


----------



## cpuhack.com (Apr 25, 2002)

The best suggestion yet!  

Although, I spose the weight of an auto could do the trick too...without hurting your hands as much. Those darn hard drives are sure sturdy now a days...


----------



## MacFromOK (Mar 19, 2001)

_____________________________________________
LOL cpuhack, 

Didn't ya see that ad where the Dell laptop still
worked after the guy accidentally ran over it...  

Cheers, Mac


----------

