11 December 2009

MS-DOS Commands

How to Change File attributes in DOS

To change the attributes of these files type the following

ATTRIB –R –S –H

For example to change the attributes of MSDOS.SYS type the following

ATTRIB –R –S –H C:\MSDOS.SYS

So now that you know how to remove a file’s attributes, I will now show you how to add them back.

To add the attributes of these files back type the following:

ATTRIB +R +S +H

For example to change the attributes of MSDOS.SYS type the following

ATTRIB +R +S +H C:\MSDOS.SYS

How to Copy Files in DOS

To copy the file config.bak and move it to a different directory (TEMP folder) type

COPY C:\CONFIG.BAK C:\TEMP\CONFIG.BAK

A confirmation of “1 file(s) copied will appear

If the file you are copying is not there then the above will happened with the “File not found” error message.

As noted in the picture above you can copy the file and rename the file and/or the extension at the same time. The above example shows the extension being renamed

How to Create And Remove directories in MSDOS

To make a Directory type “MD WIN” (MD stands for Make Directory)

The above picture shows the creation of a directory (MD WIN) and then the removal of the same directory (RD WIN). The directory being created is called WIN

NOTE WIN IS THE NAME OF THE DIRECTORY WE ARE CREATING, AND ALSO YOU CAN ONLY REMOVE A DIRECTORY IF IT IS EMPTY

How to DEBUG and CLEAR the NVRAM

The following debug routine will clear CMOS, BIOS, Passwords, Settings, Viruses, etc. During this process you may get returned characters which are an indication that the string has gone in, if you by chance you get ERROR insure that you have typed the line in correctly, if not retype. Insure that you do not skip any lines.

A

MOV AX,0

MOV AX,CX

OUT 70,AL

MOV AX,0

OUT 71,AL

INC CX

CMP CX,100

JB 103

INT 20

(Blank Line – Important)

G By pressing G this will execute the above script,

Q

Go Straight into BIOS and correct Time, Dates, Processor speed etc.

How to DEBUG and DELETE the DRIVE & PARTITIONS

The following debug routine will clear the hard drive and partitions. During this process you may get returned characters which are an indication that the string has gone in, if by chance you get an ERROR insure that you have typed the line in correctly, if not retype. Insure that you do not skip any lines.

F 200 L1000 0 (Hit Enter)

A CS:100 (Hit Enter)

MOV AX, 301 (Hit Enter)

MOV BX, 200 (Hit Enter)

MOV CX, 1 (Hit Enter)

MOV DX, 80 (Hit Enter) (80 for HD 0, 81 for HD 1)

INT 13 (Hit Enter)

INT 20 (Hit Enter)

(Blank Line – Important) (Hit Enter)

G (Hit Enter) By pressing G this will execute the above script,

Q (Hit Enter)

Note: You will now have to reboot and use Fdisk and format to set up partitions.

How to Delete a Folder and it’s Contents in DOS

To delete a folder in DOS you will have to use the "Deltree" command, for example to delete the windows directory you type:

DELTREE C:\WINDOWS\Temp\Cookies

You will then be prompted for a Y or N answer

Pressing “Y” and enter will start the deletion of the folder and all it’s contents, including subdirectories this will take several minutes, when finished it will be gone.

Pressing “N” and enter will cancel the operation.

This command is irreversible, so be careful in its deployment


No comments:

Post a Comment