This is an excellent chance to learn DEBUG!
How to use: create a new file, copy the above into it, save it as KILLHDD.BAT, put it on a boot disk (DEBUG.EXE must be there), and find an unused hard disk to experiment on.
Question: before, I had only heard of examples that clear sector 0. This is the first time I’ve seen a DEBUG program that zeroes the entire hard disk.
Please help analyze it.
@ECHO OFF
ECHO BE VERY CAREFUL, KILLHDD.bat WILL REMOVE EVRYTHING FROM YOUR DISK.
ECHO+
IF NOT EXIST %0 GOTO ERROR
ECHO PRESS A KEY TO DELETE ALL DATA ON YOUR HARD DISK, CTRL+C TO CANCEL.
pause >nul
DEBUG <%0
ECHO SUCCESS!
ECHO Computer is HALTED, Hit Ctrl+Alt+Del To Reboot . . .
CTTY NUL
A 100
INT 13
RAX
0301
RBX
0200
F 200 L 200 0
RCX
0001
RDX
0080
P
Q
;REPLACE 0080 WITH 0081 IF YOU
;WANT TO CLEAR THE SECOND PHYSICAL
;HDD, 0082 FOR THE THIRD HDD,ETC.
:ERROR
ECHO YOU MUST TYPE THE FULL FILE NAME (KILLHDD.BAT) TO EXECUTE.
How to use: create a new file, copy the above into it, save it as KILLHDD.BAT, put it on a boot disk (DEBUG.EXE must be there), and find an unused hard disk to experiment on.
Question: before, I had only heard of examples that clear sector 0. This is the first time I’ve seen a DEBUG program that zeroes the entire hard disk.
Please help analyze it.
DOS之家 http://doshome.com 站长 葛明阳




