These are all of the DOS external commands
Note: Some are not available with every version of DOS!
FDISK
FDISK is a straight forward program to use if you understand partitions. Here I will cover some tricky things that aren't straight forward when using FDISK. When you go to create a partition, fdisk will first ask you if you want to use all available space for the new partition. Remember, windoze95 A, DOS 6, and DOS 5 can't have any more than 2 Gigs for any single partition. FDISK will have "2048" as the default partition size (In Megabytes) even if you have more available space on your hard drive. If this value is ok, fdisk will automatically make your new partition and set it active. If you need to change the default size of your partition, you will have to go back and manually make it active. This is option 2 from the main menu in fdisk. Otherwise, your hard drive will not be bootable, even after you format and transfer the DOS system files to it with SYS. If you are just adding another hard disk to your system and you will NOT be booting from this drive, it isn't necessary to make your new partition active. And just for the record, you must format you partition after you create it.
Here are all switches FDISK will accept:
/STATUS this switch shows you current partition info without having to mess with FDISK
/X this switch makes FDISK ignore extended disk support if you are getting "disk access" or "stack overflow" error messages.
/MBR an undocumented function to re-write the Master Boot Record on your hard drive. The only down side is that I've heard it will sometimes re-write the partition table depending on whether it's intact. At this moment I don't know how it determines this, so be cautious. I have used this feature many times without any data loss though. It's also handy for cleaning out boot sector viruses; be careful with viruses that hide the original boot sector like the Stoned virus. If you have any third party boot loaders (LILO, System Commander, ect.) this will eradicate them and make any active DOS partition your default OS to boot to. A handy thing to remember. (I recently discovered that the FDISK/MBR option will not make your DOS partition your default boot partition to if it is not the first partition on your hard disk. Anyone with more info about why that is please send me a note! :-)
Note to all who use a version of DOS that predates DOS 5:
FDISK from versions of DOS before 5 do not accept any switches. They also report the disk size in cylinders, not megabytes. Also, as I mentioned earlier, the largest partition you can have is 33MB with these older versions of DOS.
FORMAT
Just for the record, all of the following switches do their thing after a full format has been done, unless otherwise specified.
/S this copies system files to you disk after it's formatted (Makes the disk bootable)
/V [label] labels the disk with the name specified by [label]
/Q does a quick format- basically it just overwrites the FAT and root directory, does not check for bad sectors or overwrite the data section of the disk
/F: [size] lets you tell FORMAT what density to format the disk as. [size] can be any of the following: {160, 180, 320, 360, 720, 1.2, 1.44, 2.88} These values are in reference to how many kilobytes are on a disk- 160 is for a single sided 160K 5 1/4" disk, 1.2 is a HIGH density 1200K 5 1/4", 720 is a DOUBLE DENSITY 720K 3 1/2", ect. You can format a HIGH DENSITY 3 1/2" as a DOUBLE DENSITY 3 1/2" disk with this switch, if you ever need to.
Here is an undocumented switch for use with DOS 7.1's FORMAT (Windoze 95 B) that lets you specify the cluster size used on your hard disk (And possibly on a floppy):
/Z: n where n is the number of sectors per cluster
These switches are also undocumented by micro$oft. They are only found in FORMAT from DOS 5 and higher.
/AUTOTEST
/U
/SELECT
/BACKUP
Try these out and see what happens. Various combinations will make a floppy disk unusable, so experiment! I have found they do slightly different things between versions too (Specifically, /SELECT). It's also possible to create a divide overflow with FORMAT if you tell it to format with 999 tracks and around 50 sectors per track.
C:\>format a: /T:999 /N:50
An interesting note is that micro$oft has used the /AUTOTEST switch in a batchfile that comes with windoze 98. It is in a batchfile located in your C:\WINDOWS\COMMAND directory. I don't remember it's name, but it is used to make a startup diskette.
ATTRIB
R stands for the READ-ONLY attribute
A stands for the ARCHIVE attribute
S stands for the SYSTEM attribute
H stands for the HIDDEN attribute
+ adds the selected attribute to the specified file
- removes the selected attribute from the selected file
/S performs the attribute change on all files in the directory you specify
What it all means! The READ-ONLY attribute protects a file so nothing can change it (Except the ATTRIB command). The ARCHIVE setting has no specific effect on the file itself, but was mainly used by hard disk backup programs. Most backup programs can be set to only backup files with their ARCHIVE bit set. The SYSTEM attribute is used on system files. These are special files that are needed for DOS (And windoze 95) to run. The SYSTEM attribute also makes a file hidden (But without the HIDDEN attribute being set). If you remove the SYSTEM attribute from the DOS kernel files in your root directory (MSDOS.SYS and IO.SYS in MSDOS or IBMBIO.SYS and IBMDOS.SYS for PCDOS) your computer will not boot up the next time you try to turn it on. I bet you can guess what the HIDDEN attribute does! Yep, makes files invisible to the DIR command. Note: the TYPE command see's right through hidden files.
How to use ATTRIB:
C:\>attrib -s -r -h C:\msdos.sys
This example removes the SYSTEM, READ-ONLY, and HIDDEN attributes from a file called MSDOS.SYS in the root directory. You could then alter MSDOS.SYS. (In windoze 95 MSDOS.SYS is a text file you can change options in, in DOS 6.22 and below MSDOS.SYS is a binary file that you wouldn't want to mess with- unless you are me!) To restore those attributes to MSDOS.SYS just change the "-" to a "+" in front of the attributes.
C:\>attrib +s +r +h C:\msdos.sys
Note: it does not matter in which order you change the attributes. In DOS 6 and up you must change all the attributes at once (Except for the ARCHIVE bit) or DOS will give you the following error message: "Not resetting system file C:\MSDOS.SYS" for any file with these attributes set. If the file doesn't have the SYSTEM bit set, it would give you "Not resetting hidden file C:\MSDOS.SYS". This is a never ending cycle unless you change the SYSTEM,
READ-ONLY, and HIDDEN attributes all at once. Any DOS version below 6 will allow you to change just one attribute at a time if you so desired. Also, in DOS 3.3 and below, ATTRIB does NOT allow you to change the HIDDEN attribute in a file. You can make a file have the HIDDEN attribute if you are competent in DEBUG or a low level disk editor, but not with ATTRIB.
SYS
C:\>sys a: where a: is the drive you are "sys'ing"
One VERY important note, for SYS to work it must know where to find the system files. By default it looks on the current drive you are on (If you're on the C: drive, it looks to C:\ for the system files.) If the drive you are currently in does not have the system files, SYS may give you "Invalid function" or "Can not find system files". If your current drive doesn't have these files, you can tell SYS where to find them like so:
C:\>sys c:\ a: where "c:\" is the location of your system files, and "a:" is the drive you are wanting to make a boot disk in
Rather than trying to remember the second example, just be sure you always use SYS from your C: drive (As long as you boot off your C: drive!) One more note, you can't see the system files with just DIR, you need to use DIR /A/P or they will be invisible.
(That's for windoze 95/98 users, for users of DOS 5 through 6.22, use DIR, -yes include the comma! If you have a DOS below 5, yer on yer own!)
EDIT
/B - Forces monochrome mode.
/H - Displays the maximum number of lines possible for your hardware.
/R - Load file('s) in read-only mode.
/S - Forces the use of short filenames.
/<nnn> - Load binary file('s), wrapping lines to <nnn> characters wide.
Wildcards and multiple file specs can be given.
Most of you can ignore all of these switches. I will tell you a little secret: I didn't even know EDIT accepted any switches until I wrote this section! Hmmmm, anyone out there ever used EDIT in place of DEBUG with /<nnn>? Normal usage of EDIT is as follows:
C:\>edit myfile.txt
Not to tough! Since EDIT has it's own online help, you should be able to figure out any other problems you may have once EDIT starts up. One last note: you can produce
control characters by typing <CTRL+P> followed by any key that can make a control character (The ESCAPE KEY would make the escape character- for use in escape sequences.)
DELTREE
EXE2BIN
GRAPHICS
MORE
C:>type letter.txt | more
The "|" is the PIPE, it redirects the output of a command into the command on the right of it. MORE must be in your current directory or PATH for this to work. Note: MORE creates a temporary file when you use it. If you do not have an environment variable set that defines your TEMP directory MORE tries to make its temp file in your current directory. This becomes important if you try to use MORE while using write protected floppy. MORE will give you: "Intermediate file error during pipe" because a temp file cannot be created. You can un-write-protect your floppy or just set an environment variable like so:
C:\set temp=c:\windows\temp
You can change the variable to point to any drive or folder you want as long as it is not a read only drive.
SCANDISK
CHKDSK
/F automatically fixes any errors found
/V shows every file on your disk
TREE
APPEND
ASSIGN
C:\assign x:=y: where x: is the drive letter to be reassigned; and y: is the drive x: will be assigned to
It accepts one switch, which tells you the current assigned drives:
C:\assign /status
Just typing ASSIGN by itself after you have already ASSIGNed a drive will undo the "ASSIGN". You can only assign one drive at a time. Example: you cant assign both the A: and B: drive to drive C: at the same time.
There is some fun to be had with ASSIGN. You can use SUBST to make a drive letter out of a subdirectory, and then "ASSIGN" it over your C: drive. Be careful, you can lock yourself out of your computer that way (Until the next reboot anyway). There are some other things you might be able to do also if you think about it :-)
SUBST
C:\subst x: y:\path where x: will be the new drive letter; and "y:\path" is the drive and directory you want to put at drive x:
There is one switch you can use with it:
C:\subst x: /D this undoes the substitution of drive "x:"
You can just type SUBST by itself to see all drives you currently have assigned. The only limit to how many drives you can SUBST is the amount of letters in the alphabet. Also you remember about the LASTDRIVE option used in your CONFIG.SYS file. Unless you set it in your CONFIG.SYS file, you wont be able to SUBST any drives after E:. Change it's value to any letter you want, up to Z:.
DISKCOMP
C:\diskcomp a: b: this is simple enough, it compares drive A: to B:
And here are the two switches you can use with it:
/1 only compares the first side of the disks
/8 only checks the first 8 sectors of each track
These switches are mostly for use if you have OLD OLD OLD 5 1/4" drives. Early floppies only used one side of the disk (160k and 180k of whopping space on these!). After these disks they started to use 9 tracks per sector to cram more on them. That's the only reason for these switches.
Now, I know those of you with only one floppy drive are saying, "What if I don't have a B: drive?!". Use DISKCOMP like this:
C:\diskcomp a: a:
DISKCOMP will ask you to insert the first diskette into drive A:, then it will scan this disk. It will then ask for the second disk and scan it. If they are
identical it will tell you, if they are not it will also tell you.
BACKUP