Debug Script to Remove Partitions

Posted On 2008-07-01 by FortyPoundHead
Tags: Windows Commandline Scripting Windows
Views: 1761

Type the command in the center column of Table 1 into a file using a text editor such as MS-DOS Editor and then use input redirection to feed the resulting file into Debug. For example, if you typed the commands into a file called HDPART.SCR, you would clear your partition table by typing the following at the MS-DOS command prompt and then pressing ENTER:

debug < hdpart.scr

Debug Enter Debug Comments
Prompts Commands
- A 100 Assemble from CS:0100.

nnnn:0100 INT 13 Call interrupt 13.

nnnn:0102 press the (nnnn in the segment address).

- RAX Replace AX register.

AX 0000

: 0301 Write on sector.

- RBX Replace BX register.

BX 0000

: 0200 Start from ES:200.

- F 200 L 200 0 We want to write zeros.

- RCX Replace CX register.

CX 0000

: 0001 Cylinder, 0, sector 1.

- RDX Replace DX register.

DX 0000

: 0080 First physical hard disk, head
0. (Substitute 0081 for this
entry if you are clearing the
table on the second physical
hard disk, 0082 if you are
clearing the third physical
hard disk, and so forth).

- P Proceed (Debug will display
several lines of information).

- Q Quit Debug.

About the Author

has posted a total of 1974 articles.

Comments On This Post

No comments on this post yet!

Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.

Your IP address is:

Before you can post, you need to prove you are human. If you log in, this test goes away.

Code Links