
DOS as a seperate Operating system ceased to exist with the advent of Windows 95, prior to Win95 you had to install DOS (from three 1.44 floppy disks) then if you wished Windows (from 8 fd's) the last 'stand alone' version of DOS was V6.22 and Windows was V3.11.
A lot of people thought Windows 95 was the end of civilisation as we knew it and some thought it the spawn of the devil (sorry Bill), however most of us, as is the way of things grew to accept it.
As we found our way around our new 'friend' we realised that in some ways it was 'Dumber' than DOS, taking longer to delete, copy and move files amongst other things. Users nowdays will if they take the time find this still to be the case if they take the time to learn The cutdown DOS that still lives behind the 'Command' window.
I've written this section with an in depth view of true DOS , but bear in mind there are dissimilarities between it and what's available now.

The three DOS 6.22 disks

The DOS (Command) environment
DOS (Disk Operating System) was the first OS for the IBM based PC. It provided the user with the functionality that became available in Windows and a lot more beside.
The DOS environment is termed a "command line" environment, where the user types commands at a cursor, hits the return key and the command is actuated.
The advent of Windows led users away from DOS, but to the informed user the DOS environment can for example allow far quicker manipulation of files, be that copying, moving, or deleting
DOS commands are typed at a prompt, so at the 'C:\>' prompt you could type Format a:, this would format a floppy disk in the 'A' drive.
The commands are listed below and each may be used with 'switches' which are explained later.
ASSOC Displays or modifies file extension associations
PATH
The path statement sets or displays a search path for executable files, that is files with the suffix .exe (executable), .com (command), or .bat (batch), so typing a command in the
PATH [[drive:]path[;...][;%PATH%]
PATH ;
Type PATH ; to clear all search-path settings and direct cmd.exe to search only in the current directory.
Type PATH without parameters to display the current path.
Including %PATH% in the new path setting causes the old path to be appended to the new setting.

![]()
Wildcards
Wildcards are used when you wish to carry out a command on a number of files, they are used in conjunction with commands that manipulate files, such as move. copy or delete.
The wildcard symbol ‘*’ is substituted for a character in a command. For example:
dir *at.txt
would return a listing that might contain:
cat.txtwhile the command del cat.* would delete:
cat.txt
cat.com
cat.exe
cat.dll
move c:\files\*at.* d:\newfiles\ would move (not copy) the files within the search criteria, from the source directory (c:\files\) to the destination directory (d:\newfiles\ ).
cat.txt
mat.txt
fat.txt
rat.txt
cat.com
cat.exe
cat.dll
![]()
Starting a DOS session
To start a DOS session ‘click’ on the Start botton on the taskbar (usually at the bottom of the screen) and when the menu appears select ‘Run’. This will bring up a dialoge box (Fig 2-1), type cmd and select OK, or press the return key and a DOS (Command) window will open (Fig 2-2).

Fig 2-1

Fig 2-2
Setting the DOS Prompt
By default Windows the command interpreter will show the current drive/path but you may wish to customise the prompt you see in the DOS window, you may either do this ‘on the fly’ by typing prompt= followed by one or more of the options listed below, for example typing ‘prompt=$d $t’ and pressing the return key will give you a prompt showing both the date and time as in Fig 2-3.

Fig 2-3
$P$G Displays at the prompt the current drive/path and the ">" symbol. Other commands are:
$$ $ (dollar sign)
Open any word processor (notepad will do) and simply type the command:
prompt=$d $t
Then save the file as c:\autoexec.bat. Restart the computer and return to the DOS window. you will now see the prompt with the attributes you set.

The Directory structure
The directory structure in MSDOS as with all operating systems is pyramidic, with the root of a drive at the top of the pyramid. The root is generally symbolised by a drive letter (c:\) and this pyramidic structure may be echoed by:
Additional hard drives
Partitioned hard drives
Network drives
other devices (CD ROM, Zip Drives etc.)
These extra drives (D:, E:, etc.) are not part of the directory structure of the other drives, and to switch to another drive you will need to type in the drive letter. such a system with several drives all at the same level is called a ‘flat’ system.
Fig 2-1 Illustrates the directory structure of a typical one drive PC. Fig 2-4 shows a "flat" drive/directory structure of a multi drived, or networked PC, Fig 2-5 shows a multi-drived, or networked PC.


Fig 2-4 A one drive PC

Fig2-5 A multi-drived, or networked PC

Navigating the Directory Structure
Note that commands typed at the DOS prompt are not case sensitive.
Within DOS it is possible to perform many operations on your files and directories, such as moving, copying and deleting. To achieve this you will need to become familiar with navigating the directory structure.
If for example you were in the directory C:\DOS and wished to change to the C:\APPS directory this could be done in two ways (fig 2-6).
you could type at the prompt cd \ this would take you up one level from the directory C:\DOS to the root C: you could then type cd apps and you would find yourtop in the C:\APPS directory.
You could however achieve the same thing in a less time consuming way. Assuming you are in the C:DOS directory you could type cd \apps this command takes you directly to the C:\APPS directory.

Fig2-6 A simple directory structure
In Fig 2-7 we have a more complex directory structure.To change directory from C:\FILES\WORK toC:\APPS\WP may be done in a similar way to the example above, by typing cd c:\apps\wp howeverwe can, should we wish achieve this by either changing directory to the root (C:) using the ‘\’ switch as in cd\ or by changing up one level at a time using the ‘..’, as in cd..
Alternately typing cd\apps\WP will work if you are familiar (can remember) the directory structure of your PC.

Fig2-7 A more complex directory structure
Windows95 and later
It also allowed, should you be connected to a network, access to other computers on that network , via Network Neighbourhood’.
Fig 2-8 The Windows Desktop
From Windows 95, access to utilities such as the ‘Control Panel’ was at the same level as the local or networked drives (Fig 2-9)
Fig 2-9

File manipulation commands in DOS mode
There are a number of useful commands which can be issued at the DOS prompt. Given an understanding of those commands you can speed up simple tasks such as deleting unwanted files. moving groups of files from one location to another, or copying files.
If for example you wanted to copy all the files, as a backup, from C:/files to H:/ files (perhaps a networked drive) the steps would be;
|
|
In Windows |
In DOS |
|
| (assuming a start from the desktop) | (assuming a start from the desktop) | ||
| (1)Move the cursor over My computer and click | (1)Move the cursor over the 'Start' button and click | ||
| (2)Move the cursor over the 'C:' drive and click | (2)Select 'Run' and click | ||
| (3)Move the cursor over the 'Edit' and 'right click' | (3)type cmd and hit return on the keyboard | ||
| (4)Move the cursor over the 'Select all' and click | (4)type copy C:\files\*.* /s H:\files /y | ||
| (5)Move the cursor over 'Copy' and click | --------------------------------------DONE------------------------------------- | ||
| (6)Move the cursor over the 'Address bar' 'down arrow' and click |
The Winner |
||
| (7)Move the cursor over 'H: drive and 'click' | Note The /s switch means and subdirectories, | ||
| (8)Move the cursor over 'Edit' and click | the /y (yes) means perform the task without warning me about | ||
| (9)Move the cursor over 'Paste' and click | overwriting older files with the same name. | ||
| (10) In the 'Conform Folder Replace' box click on 'Yes to all' |
|
||
| -----------------------------------DONE----------------------------------- |
The major commands and their usage are listed below.
DEL
Syntax
del [drive:][path]filenameAs del c:\temp *.* /y
by default you will be asked to confirm this operation
DELTREE
Deletes a Directory, any subdirectories, and any files in those directories.Syntax
deltree [drive:][path]filename
CD or CHDIR
COPY
Copies one or more files to the location you specify
This command can also be used to combine files. When more than one file is copied, MS-DOS displays each filename as the file is copied
Syntax
COPY [source] [destination]
source
Specifies the location and name of a file or set of files from which you want to copy. Source can consist of a drive letter and colon, a directory name, a filename, or a combination.
Destination
Specifies the location and name of a file or set of files to which you want to copy. Destination can consist of a drive letter and colon, a directory name, a filename, or a combination.
Switches
/Y
Indicates that you want COPY to replace existing file(s) without prompting you for confirmation.
Copies directories, their subdirectories, and files (except hidden and system files).
With this command, you can copy all the files in a directory, including the files in the subdirectories of that directory.
Syntax
XCOPY source [destination][/S]
source
Source must include either a drive or a path to the location and names of the files you want to copy..
destination
Specifies the destination of the files you want to copy. Destination can include a drive letter and colon, a directory name, a filename, or any combination.
Switches
/Y
Indicates that you want XCOPY to replace existing file(s) without prompting you for confirmation.
/S
Copies directories and subdirectories, unless they are empty. If you omit this switch, XCOPY works within a single directory
MOVE
Moves one or more files to the location you specify.
Syntax
MOVE [/Y|/-Y] [drive:][path]filename[,[drive:][path]filename[...]] destination
[drive:][path]filename
Moving a file to an existing file overwrites the existing file.
Switches
/Y
Indicates that you want MOVE to replace existing file(s) without prompting you for confirmation
MKDIR (MD)
Creates a directory.
Syntax
MKDIR [drive:]path
MD [drive:]path
RMDIR (RD)
Deletes a directory.
Syntax
RMDIR [drive:]path
RD [drive:]path
This command will not work on a directory with files in it. Should you wish to remove such a directory use deltree instead.
Other DOS Commands
AT
The AT command schedules commands and programs to run on a computer at a specified time and date. The Schedule service must be running to use the AT command.
AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE] [ /EVERY:date[,...] | /NEXT:date[,...]] "command"
\\computername Specifies a remote computer. Commands are scheduled on the local computer if this parameter is omitted.
id Is an identification number assigned to a scheduled command.
/delete Cancels a scheduled command. If id is omitted, all the scheduled commands on the computer are canceled.
/yes Used with cancel all jobs command when no further confirmation is desired.
time Specifies the time when command is to run.
/interactive Allows the job to interact with the desktop of the user who is logged on at the time the job runs.
/every:date[,...] Runs the command on each specified day(s) of the week or month. If date is omitted, the current day of the month is assumed.
/next:date[,...] Runs the specified command on the next occurrence of the day (for example, next Thursday). If date is omitted, the current day of the month is assumed.
"command" Is the Windows NT command, or batch program to be run.
ATTRIB
Displays or changes file attributes.
CHKDSK (Checkdisk)
CHKDSK [volume[[path]filename]]] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]]
volume Specifies the drive letter (followed by a colon), mount point, or volume name.
filename FAT only: Specifies the files to check for fragmentation.
/F Fixes errors on the disk.
/V On FAT/FAT32: Displays the full path and name of every file on the disk. On NTFS: Displays cleanup messages if any.
/R Locates bad sectors and recovers readable information (implies /F).
/L:size NTFS only: Changes the log file size to the specified number of kilobytes. If size is not specified, displays current size.
/X Forces the volume to dismount first if necessary. All opened handles to the volume would then be invalid (implies /F).
/I NTFS only: Performs a less vigorous check of index entries.
/C NTFS only: Skips checking of cycles within the folder structure.
CMD
CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF] [[/S] [/C | /K] string]
/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains
/S Modifies the treatment of string after /C or /K (see below)
/Q Turns echo off
/D Disable execution of AutoRun commands from registry (see below)
/A Causes the output of internal commands to a pipe or file to be ANSI
/U Causes the output of internal commands to a pipe or file to be Unicode
/T:fg Sets the foreground/background colors (see COLOR /? for more info)
/E:ON Enable command extensions (see below)
/E:OFF Disable command extensions (see below)
/F:ON Enable file and directory name completion characters (see below)
/F:OFF Disable file and directory name completion characters (see below)
/V:ON Enable delayed environment variable expansion using c as the delimiter. For example, / V:ON would allow !var! to expand the variable var at execution time. The var syntax expands variables at input time, which is quite a different thing when inside of a FOR loop.
/V:OFF Disable delayed environment expansion.
Note that multiple commands separated by the command separator ‘&&’ are accepted for string if surrounded by quotes. Also, for compatibility reasons, /X is the same as /E:ON, /Y is the same as /E:OFF and /R is the same as /C. Any other switches are ignored.
If /C or /K is specified, then the remainder of the command line after the switch is processed as a command line, where the following logic is used to process quote (") characters:
1. If all of the following conditions are met, then quote characters
on the command line are preserved:
- no /S switch
- exactly two quote characters
- no special characters between the two quote characters, where special is one of: &<>()@^|
- there are one or more whitespace characters between the the two quote characters
- the string between the two quote characters is the name of an executable file.
2. Otherwise, old behavior is to see if the first character is a quote character and if so, strip the leading character and remove the last quote character on the command line, preserving any text after the last quote character.
COMMAND.
Starts the MS-DOS command interpreter.
COMMAND [[drive:]path] [device] [/E:nnnnn] [/P] [/C string] [/MSG]
[drive:]path Specifies the directory containing COMMAND.COM file.
device Specifies the device to use for command input and output.
/E:nnnnn Sets the initial environment size to nnnnn bytes.
/P Makes the new command interpreter permanent (can’t exit).
/C string Carries out the command specified by string, and then stops.
/MSG Specifies that all error messages be stored in memory. You need to specify /P with this switch.
DIR
Displays a list of files and subdirectories in a directory.
DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N] [/O[[:]sortorder]] [/P] [/Q] [/S]
[/T[[:]timefield]] [/W] [/X] [/4]
[drive:][path][filename]
Specifies drive, directory, and/or files to list.
/A Displays files with specified attributes.
attributes are:
D Directories
R Read-only files
H Hidden files
A Files ready for archiving
S System files
/B Uses bare format (no heading information or summary).
/C Display the thousand separator in file sizes. This is the default. Use /-C to disable display of separator.
/D Same as wide but files are list sorted by column.
/L Uses lowercase.
/N New long list format where filenames are on the far right.
/O List by files in sorted order.
sortorder
N By name (alphabetic)
S By size (smallest first)
E By extension (alphabetic)
D By date/time (oldest first)
G Group directories first
/P Pauses after each screenful of information.
/Q Display the owner of the file.
/S Displays files in specified directory and all subdirectories.
/T Controls which time field displayed or used for sorting timefield
C Creation
A Last Access
W Last Written
/W Uses wide list format.
/X This displays the short names generated for non-8dot3 file names. The format is that of /N with the short name inserted before the long name. If no short name is present, blanks are displayed in its place.
/4 Displays four-digit years
Switches may be preset in the DIRCMD environment variable. Override preset switches by prefixing any switch with - (hyphen)--for example, /-W.
DOSKEY
DOSKEY [/REINSTALL] [/LISTSIZE=size] [/MACROS[:ALL | :exename]]
[/HISTORY] [/INSERT | /OVERSTRIKE] [/EXENAME=exename] [/MACROFILE=filename]
[macroname=[text]]
/REINSTALL Installs a new copy of Doskey.
/LISTSIZE=size Sets size of command history buffer.
/MACROS Displays all Doskey macros.
/MACROS:ALL Displays all Doskey macros for all executables which have Doskey macros.
/MACROS:exename Displays all Doskey macros for the given executable.
/HISTORY Displays all commands stored in memory.
/INSERT Specifies that new text you type is inserted in old text.
/OVERSTRIKE Specifies that new text overwrites old text.
/EXENAME=exename Specifies the executable.
/MACROFILE=filename Specifies a file of macros to install.
macroname Specifies a name for a macro you create.
text Specifies commands you want to record.
UP and DOWN ARROWS recall commands; ESC clears command line; F7 displays command history; ALT+F7 clears command history; F8 searches command history; F9 selects a command by number; ALT+F10 clears macro definitions.
EDIT
FORMAT
MORE
MORE [/E [/C] [/P] [/S] [/Tn] [+n]] < [drive:][path]filenamecommand-name | MORE [/E [/C] [/P] [/S] [/Tn] [+n]]
MORE /E [/C] [/P] [/S] [/Tn] [+n] [files]
[drive:][path]filename Specifies a file to display one screen at a time.
command-name Specifies a command whose output will be displayed.
/E Enable extended featuresXCOPY
XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/I] [/Q] [/F] [/L] [/H] [/R]
[/T] [/U] [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z]
[/EXCLUDE:file1[+file2][+file3]...]
source Specifies the file(s) to copy.
destination Specifies the location and/or name of new files.
/A Copies only files with the archive attribute set, doesn't change the attribute.
/M Copies only files with the archive attribute set,turns off the archive attribute.
/D:m-d-y Copies files changed on or after the specified date. If no date is given, copies only those files whose source time is newer than the destination time.
![]()
Learning The DOS commands is a great way of saving time, gives you an insight into the commands behind all the mouse wiggling, impresses the natives and makes you feel like a proper Anorak!.

© Allen. C. Roffey 11:55 17/09/2005
