Sunday, October 7, 2007

Hmnnnn Wild?

Wild Card Character

A special symbol that stands for one or more characters. Many operating systems and applications support wild cards for identifying files and directories. This enables you to select multiple files with a single specification.

For example: In Windows, the asterisk (*) is a wild card that stands for any combination of letters. The file specification m* therefore, refers to all files that begin with m. Similarly, the specification m*.doc refers to all files that start with m and end with .doc. Many word processors also support wild cards for performing text searches.

The Question mark

wild card [?] matches any single character. For instance, the file spec [?SALES.DOC] includes all files that start with any character; the remaining letters must be [SALES], and the file must have the extension [DOC]. The following files would be included in this group:


The following files would not be included:

SWSALES.DOC (matches only 1 character)
ESALES.XLS (extensions dont match)

Like all operating systems, Unix files have names. (Unix directories, devices, and so on also have filenames — and are treated like files (Section 1.19).) The names are words (sequences of characters) that let you identify a file.

Older versions of Unix had some restrictions on the length of a filename (14 characters), but modern versions have removed these restrictions for all practical purposes. Sooner or later you will run into a limit, but if so, you are probably being unnecessarily verbose.

Technically, a filename can be made from almost any group of characters (including nonprinting characters and numbers) except a slash (/).

However, you should avoid filenames containing most punctuation marks and all nonprinting characters. To be safe, limit your filenames to the following characters:

Upper- and lowercase characters
Unix filenames are always case sensitive. That is, upper- and lowercase letters are always different (unlike Microsoft Windows and others that consider upper- and lowercase letters the same).

Therefore, myfile and Myfile are different files. It is usually a bad idea to have files whose names differ only in their capitalization, but that's your decision.
Underscores (_)

Underscores are handy for separating "words" in a filename to make them more readable. For example, my_long_filename is easier to read than mylongfilename.
Periods (.)

Periods are used by some programs (such as the C compiler) to separate filenames from filename extensions. Extensions are used by these programs to recognize the type of file to be processed, but they are not treated specially by the shell, the kernel, or other Unix programs.

Filenames that begin with a period are treated specially by the shell: wildcards won't match them unless you include the period (like .*).

The ls command, which lists your files, ignores files whose names begin with a period unless you give it a special option (ls -a. Special configuration files are often "hidden" in directories by beginning their names with a period.

Directory Organization

Think about how you store letters in your office. In your office, you may have a filing cabinet.

In that filing cabinet, you probably have folders that pertain to different projects, employees, organizations, or some other grouping--maybe logical, maybe not.

Within each folder you have articles, letters, diagrams, reports--anything that you want to save. This storage method carries over to Microsoft's MS-DOS and Windows 95/98 Disk Operating Systems (DOS).

With Microsoft's DOS, a disk is like a filing cabinet. Within that disk, you have directories or areas set aside for certain files such as memos, articles, or diagrams. The same type items that you store in a folder are stored in electronic form in a file. That file is then stored in a directory.

Root Directory and the Path

The main directory is called the root directory. All other directories are branches of this directory, much like the roots of a tree. Directories can contain files, programs, or other directories. The root directory is designated by a backslash (\).

To get to a particular file, you must trace the path from the root directory to the directory that the file is located in. The path is the list of directories, starting with the root.

Each directory name is separated by a backslash (\). For example, the path [C:>\wp\reports] gives you access to the directories as follows:

Start at drive C:\
Go from the root directory (\) to the [ WP] directory
Go from the [WP] directory to the [REPORTS] directory.

When we go to a directory it is the same as opening a folder in a file drawer.

Note: The paths for each of these directories would look like the following:
C:\ ----------------------------- Root Directory
C:\dos\ ----------------------- DOS subdirectory (1 level)
C:\Lotus\ --------------------- Lotus Subdirectory (1 Level)
C:\wp\ ------------------------- Word Perfect Subdirectory (1 level)
C:\wp\Report ---------------- Report Subdirectory (2 levels)

Drive Identification

Microsoft's Disk Operating Systems identify each drive (including the hard disk) by a letter. For example the first diskette drive on any system is always drive [A:] and the second is always drive [B:], etc. On some systems drive "A" is a 3-1/2 inch floppy drive.

On other systems it can be a 5-1/4 floppy drive.

The first logical or physical hard disk is always identified as [C:].

To specify the disk drive in a path statement you always give the drive letter followed by a colon.

Examples: For each hard disk or Floppy disk, the top level directory is always called the [ROOT] directory.

Sub-directories - Since one directory can contain entries for other directories, the subordinate directories can be referred to as subdirectories.

These subdirectories are just like any other directory; they're just subordinate to a higher-level directory.

As a result, subdirectories can also be referred to as directories.
This is the same as a letter in a file is a subordinate to the higher level file folder

DIR (DOS the EaSy WAY)

Type: Internal (1.0 and later)

Syntax:DIR [d:][path][filename] [/A:(attributes)] [/O:(order)] [/B][/C][/CH][/L][/S][/P] [/W]

Purpose: Displays directory of files and directories stored on disk.

DiscussionIn addition to files and directories, DIR also displays both the volume name and amount of free storage space on the disk (if there are files stored in the current directory). Note that both of these are for the entire DISK, not just for the path you specified.The DIR command is also useful if you want to know what directories have been created on the specified disk.

The directories will be displayed along with the files on the disk. They can be identified by the DIR label that follows the directory name.Wildcard characters (? and *) can be used to specify groups of files. For more information about the DIR command, see Chapter 2, Using Common DOS Commands, in the downloadable book DOS the Easy Way. When you use the DIR command, it will display all files that match the path and filename specifications, along with their size in bytes and the time and date of their last modification.

If you don`t enter one of the options, the entire list will be displayed, even if the list is too long to fit on one screen. To limit the amount of data displayed, use either of the two options described below.

/A:attributes Only the files whose attributes match the ones you specify will be displayed. You can enter a sequence of attributes after the colon. It is not necessary to enter spaces between entries. This option is available with DOS Versions 5 and 6.

The possible attributes are:H-H - Hidden (or not hidden) files.

S-S - System (or non system) files.
D-D - Directories (or files only).
R-R - Read-only (or read/write) files.
A-A - Archivable (or already archived) files.


Allows you to specify the order in which the entries will be displayed.

This option is available with DOS Versions 5 and 6.The possible options are:

N-N - By name (alphabetical or reverse alphabetical).
E-E - By extension ( alphabetical or reverse alphabetical).
D-D - By date and time (chronologically or reverse).
S-S - By size (increasing or decreasing).
C-C - Sorts by DoubleSpace compression ratio lowest to highest or highest to lowest.

(Version 6.0 only)

G-G - Group directories (before, or after) other files.

Other Switches

/B - (Bare format) Displays only file names.
/C - Displays the compression ratio of files compressed using DBLSPACE.

This option is available with DOS Version 6.

/CH - Displays the compression ratios of files on a DoubleSpace volume.

Cannot be used at the same time as the

/C option. This option is available with DOS Version 6.

/L Information is displayed in lowercase letters. This option is available with DOS Versions 5 and 6.

/S Displays file entries in the specified directory and all subdirectories located below it hierarchically.

/P Pauses when the screen is full. Press any key to display another screen full of data. /W Displays only filenames and directory names (without the added information about each file) in a five-wide display format.


To display only files with the

.TXT filename extension on the current drive that begin with the letters FIL, enter

dir fil*.TXT To display only files on drive C that have no filename extension, enter

dirc:*. This form of the DIR command will also display directories.

They can be identified by the DIR label that follows the directory name.

Disk formatting

Disk formatting is the process of preparing a hard disk or other storage medium for use, including setting up an empty file system. A variety of utilities and programs exist for this task; pictured to the right is the iconic FORMAT.COM of MS-DOS and PC-DOS.

Large disks can be partitioned, divided into logical sections that are formatted with their own file systems. This is normally only done on hard disks because of the small sizes of other disk types, as well as compatibility issues.

A corrupted operating system can be reverted to a clean state by formatting the disk and reinstalling the OS, as a drastic way of combatting a software problem or malware infection. Obviously, important files should be backed up beforehand.

Two levels of formatting

Formatting a disk involves two quite different processes known as low-level and high-level formatting. The former deals with the formatting of disk surfaces and installing characteristics like sector numbers that are visible to, and used by, the disk controller hardware, while the latter deals with file system specific information written by the operating system.

Formatting a disk involves two quite different processes known as low-level and high-level formatting. The former deals with the formatting of disk surfaces and installing characteristics like sector numbers that are visible to, and used by, the disk controller hardware, while the latter deals with file system specific information written by the operating system.

Low-level formatting of floppy disks

The low-level format of floppy disks (and early hard disks) is performed by the disk drive hardware.

The process is most easily described with a standard 1.44 MB floppy disk in mind. Low-level formatting of the floppy normally writes 18 sectors of 512 bytes each on each of 160 tracks (80 on each side) of the floppy disk, providing 1,474,560 bytes of storage on the floppy.

Sectors are actually physically larger than 512 bytes as they include sector numbers, CRC bytes, and other information required in order to identify and verify the sector during reading and writing. These additional bytes do not add to the overall storage capacity of the disk.

To complicate matters, different low-level formats can be used on the same media; for example, large records can be used to cut down on interrecord gap size.

Several freeware, shareware and free software programs (e.g. GParted, FDFORMAT, NFORMAT and 2M) allowed considerably more control over formatting, allowing the formatting of high-density 3 1/2" disks with a capacity up to 2 MB.

Techniques used include:

head/track sector skew (moving the sector numbering forward at side change and track stepping to reduce mechanical delay),

interleaving sectors (to minimize sector gap and thereby allowing the number of sectors per track to be increased),

increasing the number of sectors per track (while a normal 1.44 MB format uses 18 sectors per track, it's possible to increase this to a

maximum of 21), and

increasing the number of tracks (most drives could tolerate extension to 82 tracks – though some could handle more, others jammed).

Linux supports a variety of sector sizes, and DOS and Windows support a large-record-size DMF-formatted floppy format.

Low-level formatting (LLF) of hard disks

User instigated low-level formatting (LLF) of hard disks was common in the 1980s. Typically this involved setting up the MFM pattern on the disk, so that sectors of bytes could be successfully written to it. With the advent of RLL encoding, low-level formatting grew increasingly uncommon, and most modern hard disks are embedded systems, which are low-level formatted at the factory with the physical geometry dimensions and thus not subject to user intervention.

Early hard disks were quite similar to floppies, but low-level formatting was generally done by the BIOS rather than by the operating system. This process involved using the MS-DOS debug program to transfer control to a routine hidden at different addresses in different BIOSs.
Starting in the early 1990s, low-level formatting of hard drives became more complex as technology improved to:

use RLL encoding,

store a higher number of sectors on the longer outer tracks (traditionally, all tracks had the same number of sectors, as is still the case with floppy disks),

encode track numbers into the disk surface to simplify hardware, and

increase the mechanical speeds of the drive.

Disk Reinitialization

While it's impossible to perform an LLF on most modern hard drives (since the mid-1990s) outside the factory, the term "low-level format" is still being used (erroneously) for what should be called the reinitialization of an IDE or ATA hard drive to its factory configuration (and even these terms may be misunderstood). Reinitialization should include identifying (and sparing out if possible) any sectors which cannot be written to and read back from the drive, correctly. The term has, however, been used by some to refer to only a portion of that process, in which every sector of the drive is written to; usually by writing a zero byte to every addressable location on the disk; sometimes called zero-filling.

The present ambiguity in the term "low-level format" seems to be due to both inconsistent documentation on web sites and the belief by many users that any process below a "high-level (file system) format" must be called a low-level format. Instead of correcting this mistaken idea (by clearly stating such a process cannot be performed on specific drives), various drive manufacturers have actually described reinitialization software as LLF utilities on their web sites. Since users generally have no way to determine the difference between a true LLF and reinitialization (they simply observe running the software results in a hard disk that must be partitioned and "high-level formatted"), both the misinformed user and mixed signals from various drive manufacturers have perpetuated this error. Note: Whatever possible misuse of such terms may exist (search hard drive manufacturers' web sites for all these terms), many sites do make such reinitialization utilities available (possibly as bootable floppy diskette or CD image files), to both overwrite every byte and check for damaged sectors on the hard disk.

One popular method for performing only the "zero-fill" operation on a hard disk is by writing zero-bytes to the drive using the Unix dd utility (available under Linux as well) with the "/dev/zero" stream as the input file (if=) and the drive itself (either the whole disk, or a specific partition) as the output file (of=).

High-level formatting

High-level formatting is the process of setting up an empty file system on the disk, and installing a boot sector. This alone takes little time, and is sometimes referred to as a "quick format".

In addition, the entire disk may optionally be scanned for defects, which takes considerably longer, up to several hours on larger harddisks.

In the case of floppy disks, both high- and low-level formatting are customarily done in one pass by the software. In recent years, most floppies have shipped preformatted from the factory as DOS FAT12 floppies. It is possible to format them again to other formats, if necessary.

Formatting in DOS

Under MS-DOS and PC-DOS, disk formatting is performed by the FORMAT program. FORMAT usually asks for confirmation beforehand to prevent accidental removal of data, but some versions of DOS had an undocumented /AUTOTEST option; if used, the usual confirmation is skipped and the format begins right away. The WM/FormatC macro virus uses this command to format the C: drive as soon as a document is opened.

There is also the undocumented /U parameter that performs an unconditional format which overwrites the entire partitio, preventing the recovery of data through software (but see below).

Recovery of data from a formatted disk

As with regular deletion, data on a disk is not fully destroyed during a high-level format. Instead, the area on the disk containing the data is merely marked as available (in whatever file system structure the format uses), and retains the old data until it's overwritten. If the reformatting is done with a different file system than previously existed in the partition, some data may be overwritten that wouldn't be if the same file system had been used. However, under some file systems (e.g., NTFS; but not FAT), the file indexes (such as $MFTs under NTFS, "inodes" under ext2/3, etc.) may not be written to the same exact locations. And if the partition size is increased, even FAT file systems will overwrite more data at the beginning of that new partition.

From the perspective of preventing the recovery of sensitive data through recovery tools, the data must either be completely overwritten (every sector) with random data before the format, or the format program itself must perform this overwriting; as the DOS FORMAT command did with floppy diskettes, filling every data sector with F6h bytes.


On early computers great efforts were expended on making the bootstrap loader short, in order to make it easy to toggle in via the front panel switches. It was just clever enough to read in a slightly more complex program (usually from punched cards or paper tape), to which it handed control. This program in turn read the application or operating system from a magnetic tape drive or disk drive. Thus, in successive steps, the computer "pulled itself up by its bootstraps" to a useful operating state.

Nowadays the bootstrap loader is usually found in ROM or EPROM, and reads the first stage in from a fixed location on the disk, called the "boot block". When this program gains control, it is powerful enough to load the actual OS and hand control over to it. A diskless workstation can use bootp to load its OS from the network.


There are several ways folks are getting their USB CDroms, Hard Drives, and other drives to work in DOS. One is using what's known as DUSE driver system. The second method is using what looks somewhat like standard CDrom driver files and a USB driver. Both methods appear to require loading an usbaspiX.sys file first in config.sys in most cases. The third method is a bootdisk from a USB vendor. Method 4 is getting good reviews also.
METHOD 1 - The DUSE System

Example 1 Using DUSE


Note: You can find a usbspi.sys on the internet or use on of the five different versions I've found in the Download Files section at the bottom of the page
[autoexec.bat]@echo offduseldr a:\duse.exeMSCDEX /D:USBCDROM /S /M:15 /V

Example 2 Using DUSE

[autoexec.bat]MSCDEX /D:USBCDROM /S /M:15 /V

METHOD 2 - The usbaspi.sys/usbcd.sys System - Example 1

As noted, this method seems just like loading IDE drivers, with the added entry of the usbaspiX file. The following are the relevant portions taken from a modified config.sys and autoexec.bat file which was designed to work with a Windows 98 OEM Bootdisk with the ramdrive.

The complete config.sys and autoexec.bat replacement files are available for download below, and you might want to start first with just copying them to your OEM bootdisk along with the relevant drivers and then experiment later with getting them to work on your Customized disk.
[config.sys - example 1]device=himem.sys /testmem:offdevice=usbaspiX.sysdevice=usbcdX.sys /D:mscd001
[config.sys example 2 - USB Floppy in only port, "sometimes" allows switching to CDrom after boot]device=himem.sys /testmem:offdevice=ramfd.sysdevice=usbaspiX.sys /Wdevice=usbcdX.sys /D:mscd001
[autoexec.bat]LH %ramd%:\MSCDEX.EXE /D:mscd001 /L:%CDROM%

METHOD 2 - The usbaspi.sys/usbcd.sys System - Example 2
"I finally got my Belkin external drive enclosure with a WD 120gb drive to work in DOS, and then perform a GHOST image", wrote don b. "Here's the files and config.sys that worked."
[config.sys]device=himem.sys /testmem:offdevicehigh=usbaspi1.sysdevicehigh=di1000dd.sysdevicehigh=usbcd2.sys /d:USBCD001LASTDRIVE = Z
[autoexec.bat] don b. noted that either the standard Ghost or Win98X autoexec.bat worked as is.
METHOD 2 - The usbaspi.sys/usbcd.sys System - Example 3

Herbert H. writes: "I Just solved my problem by using the files from the "virtual" DOS drive ghost03 makes when you run interactive mode. It uses IOmega USB drivers and Guest.exe. It alowed me to use my Western Digital external USB HD in DOS.
[config.sys]LASTDRIVE=ZDEVICE = usbaspi4.sys /int /allDEVICE = usbaspi5.sys /int /allDEVICE = usbaspi5.sys /int /all /D1DEVICE = usbcdX.sys /D:cd2 DEVICE = OAKCDROM.SYS /D:cd1 [For his IDE CDrom]

METHOD 3 - The datoptic System

The key driver files in dat.exe include:
usbaspi.sys 37,090 bytesnj32disk.sys 15,808sbp2aspi.sys 28,836 recommends the following config.sys for it's USB/1394 products. It's been reported tho that their drivers also work for other brands as well.
[menu]menuitem=USB,USB Bootmenuitem=1394,1394 Bootmenudefault=USB,30menucolor=7,0

Default Drive

The default drive is the first disk drive on which DOS will look for a program if no drive specification is given with the filename.

How do you know what it is? Look at the prompt. The default drive letter is part of the prompt (unless someone has changed the prompt to eliminate it).

A:\> indicates that drive A (the left or top drive in a two-drive system) is the default drive. The right (or second) drive in such a system is called drive B and the first hard disk in any system is given the letter C as its drive designation.

DOS supports many more than drives A through C. In fact, if your computer has them you can specify up to 63 drive names. (This is a "Catch 22" situation. DOS can respond to 63 drive names but converts all lower case to upper case automatically so you really can't access 63 devices.) You change drives by typing the desired default drive followed by a colon at the prompt. To change to drive C type C: as shown here:

A:\> c:
Device Names
Character oriented devices can be addressed by DOS through their names:

CON: The name for the video display and keyboard.
AUX: or COM1: This is the first asynchronous communications port which usually has a modem or other serial device connected to it. The second communications port is COM2:
PRN or LPT1: The first parallel printer port. PRN comes from printer and LPT is an old designator derived from line printer. A colon on PRN and all device names is optional in later DOS versions. The second parallel port is LPT2:
CAS1: A holdover; this is the cassette recorder port.
NUL: This is a test device. Anything sent to device NUL: goes into the bit bucket (i.e., gets thrown away).
Rules for Filenames
Like devices, disk files have to be identified so DOS can address them. These filenames have specific rules.

The basic form of a filename is:

The first part of the name to the left of the period is called the root name. The root name can be from one to eight characters long and cannot be the same as a device name. The second part to the right of the period is the extension. It is optional and, if used, can be one to three characters long.
The period is used between the root name and extension and must be present if there is an extension.
The following are legal and illegal characters in a filename:
Legal: A-Z 0-9 $#&@!()-{}'`_~
Illegal: <>\^+=?/[]";,* plus control characters and the space
Some other operating systems allow longer file names and there are commercial utilities which link a database of long names to your short names so you can find files by using more fully descriptive names.



DOS (Disk Operating System) can be used to ftp files just as well as an ftp client. The only difference being "a lot of typing" - but if you need to ftp files to and fro and you don't have an ftp client installed, follow these easy steps to ftp using DOS.
We shall use the Demon Homepages server as an example of an ftp server.

The first thing you need to do is open a command prompt. There are several ways to do this.
Click on the Start button on the task bar, navigate to Programs and choose MS-DOS Prompt. or click on the Start button, choose run, and type command in the text box and click OK.
If you are using NT, you only need to type cmd and click OK. See the example above

Navigate to the directory where your files that you want to transfer are kept.If you do not have a directory with files ready for ftp, follow the steps below:Navigate to the root directory by typing cd\ and press return.Create a directory by typing the command mkdir test and press return.Navigate to the test directory by typing cd test and press return.Your screen should now look like the example above.

To see any files within the directory type dir and press return.

Once connected, you will be presented with the welcome messages and policies of the ftp server.

FTP servers require you to log in. Type in your hostname followed by the return key.Note: some FTP servers will allow you to login as anonymous for the User.

Then type in your login password followed by the return key at the Password: prompt.Note: On anonymous servers, you can enter your e-mail address as the password.

pwd will inform you of your present working directory. To change to the directory that you wish to get/put the files to, type cd and then the directory name/path.For example:cd myfiles would place you in the myfiles directory.

To upload a file to the ftp server you will need to type put yourfilename.
To download a file from the ftp server you will need to type get yourfilename.
Note: yourfilename is case sensitive. You will need to do this each time you upload or download a file.

The ftp server will display the type of file (binary or ASCII), filename, transfer completion, size and time of transfer taken.

To check to see if the file or files are on the ftp server, type dir or ls to list the files in the current directory. If the files are in a different directory, type cd (directory path) to change to the appropriate directory.

To disconnect from the ftp server, type quit at the prompt.Always quit quit an ftp server rather that just closing the DOS Command prompt.

To see if the file you requested get yourfilename is downloaded, type dir at the MS-DOS command prompt.
Here is a list of some of the most common DOS FTP commands:

open Opens up an ftp site

cd Changes directory on remote machine

lcd Changes directory on local machine

dir Displays a list of files and folders

put Copies a file from the local to the remote machine

mput Copies multiple files from the local to the remote machine

get Copies a file from the remote to the local machine

mget Copies multiple files from the remote to the local machine

delete Deletes a file

rename Renames a file

mkdir Creates a directory on the remote machine

rmdir Removes a directory on the

Friday, October 5, 2007


DOS (from Disk Operating System) commonly refers to the family of closely related operating systems which dominated the IBM PC compatible market between 1981 and 1995 (or until about 2000, if Windows 9x systems are included): DR-DOS, FreeDOS, MS-DOS, Novell-DOS, OpenDOS, PC-DOS, PTS-DOS, ROM-DOS and several others. They are single user, single task systems. MS-DOS from Microsoft was the most widely used. These operating systems ran on IBM PC type hardware using the Intel x86 CPUs or their compatible cousins from other makers. MS-DOS is still common today and was the foundation for many of Microsoft's operating systems (from Windows 1.0 through Windows Me). MS-DOS was later abandoned as the foundation for their operating systems.

(and the IBM PC-DOS which was licensed therefrom), and its predecessor, QDOS, was an imitation of CP/M (Control Program / (for) Microcomputers) — which was the dominant disk operating system for 8-bit Intel 8080 and Zilog Z80 based microcomputers. It was first developed at Seattle Computer Products by Tim Paterson as a variant of CP/M-80 from Digital Research, but intended as an internal product for testing SCP's new 8086 CPU card for the S-100 bus. It did not run on the 8080 (or compatible) CPU needed for CP/M-80. It was called QDOS, among several other names. Microsoft licensed it from SCP, made changes and licensed the result to IBM (sold as PC-DOS) for its new 'PC' using the 8088 CPU (internally the same as the 8086), and to many other hardware manufacturers. In the later case it was sold as MS-DOS.
Digital Research produced a compatible product known as "DR-DOS", which was eventually taken over (after a buyout of Digital Research) by Novell. This became "OpenDOS" for a while after the relevant division of Novell was sold to Caldera International, now called SCO. Later, the embedded division of Caldera was "spun off" as Lineo (later renamed Embedix), which in turn sold DR-DOS to a start-up called Device Logics, who now seem to call themselves DRDOS, Inc.
DOS was one of the first operating systems for the PC compatible platform, and the first on that platform to gain widespread use (it was still widespread more than 10 years later). This was a quick and messy affair (the variant MS-DOS, sometimes colloquially referred to as Messy DOS, was developed from QDOS, which literally meant "Quick and Dirty Operating System").
IBM-PCs were only distributed with PC-DOS, whereas PC compatible computers from nearly all other manufacturers were distributed with MS-DOS. For the early years of this operating system family, PC-DOS was almost identical to MS-DOS.
Early versions of Microsoft Windows were little more than a graphical shell for DOS, and later versions of Windows were tightly integrated with MS-DOS. It is also possible to run DOS programs under OS/2 and Linux using virtual-machine emulators. Because of the long existence and ubiquity of DOS in the world of the PC-compatible platform (DOS compatible programs were made well into the '90s), DOS was often considered to be the native operating system of the PC compatible platform.
There are alternative versions of DOS, such as FreeDOS and OpenDOS. FreeDOS appeared in 1994 due to Microsoft Windows 95, which differed from Windows 3.11 by being not a shell and dispensing with MS-DOS.[1]

Essential Commands

dir: Lists names of files in current directory (folder)
dir Hello.* Lists all files whose names start with Hello.
cd C:\files: Changes directory to C:\files ("absolute" pathname)
cd myfiles: Changes directory to myfiles subdirectory of current directory ("relative" pathname)
cd ..Changes directory to "parent" of current directory
notepad MS-DOS text editor, used to create and edit ASCII textfiles
type Displays contents of ASCII textfile on screen
exit: Ends command interpreter, makes console window go away...


Starts a new copy of the Windows Command Interpreter.

COMMAND [[drive:]path] [device] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG]

[/LOW] [/Y [/[CK] command]]

[drive:] path Specifies the directory containing COMMAND.COM.
device Specifies the device to use for command input and output.
/E:nnnnn Sets the initial environment size to nnnnn bytes.
(nnnnn should be between 256 and 32,768).
/L:nnnn Specifies internal buffers length (requires /P as well).
(nnnn should be between 128 and 1,024).
/U:nnn Specifies the input buffer length (requires /P as well).
(nnn should be between 128 and 255).
/P Makes the new Command Interpreter permanent (can't exit).
/MSG Stores all error messages in memory (requires /P as well).
/LOW Forces COMMAND to keep its resident data in low memory.
/Y Steps through the batch program specified by /C or /K.
/C command Executes the specified command and returns.
/K command Executes the specified command and continues running.

CD Change Directory-------
Displays the name of or changes the current directory.

CHDIR [drive:][path]


CD [drive:][path]

.. Specifies that you want to change to the parent directory (in other words: Move up one folder in the directory tree). DOS 7, WHEN using a DOS-window, allows you to use extra dots here! If you were in C:\WINDOWS\SYSTEM\shellext, you could enter cd... to go up to C:\WINDOWS or even cd.... to get to the root.

Type CD drive: to display the current directory in the specified drive.
Type CD without parameters to display the current drive and directory.

chcp Change Code Page-------
Displays or sets the active code page number.

CHCP [nnn]
nnn Specifies a code page number.

Type CHCP without a parameter to display the active code page number.

cls Clear Screen-------
Clears the screen.

copy Copy or Concatenate Files-------
copies one or more files to another location.

COPY [/A /B] source [/A /B] [+ source [/A /B] [+ ...]] [destinati [/A /B]] [/V] [/Y /-Y]

source Specifies the file or files to be copied.

/A Indicates an ASCII text file.
/B Indicates a binary file.
destination Specifies the directory and/or filename for the new file(s).
/V Verifies that new files are written correctly.
/Y Suppresses prompting to confirm you want to overwrite an existing destination file.
/-Y Causes prompting to confirm you want to overwrite an existing destination file.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line

To append files, specify a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format).

Note this special case of the COPY command:
copy con output.txt Copy from Console to ...

After you type this command and press ENTER, MS-DOS copies everything you type to the file OUTPUT.TXT. When you are finished typing, press CTRL+Z to indicate that you want to end the file. The Control-Z character will appear on the screen as " ^Z ". You can also end a COPY CON command by pressing the F6 key. Pressing F6 also generates the Control-Z character; a " ^Z " still appears on the screen.

The following example copies information from the keyboard to a printerconnected to LPT1: copy con lpt1

ctty Change Termial Type-------
Changes the terminal device used to control your system.

CTTY device
device The terminal device you want to use, such as COM1.

Displays or sets the date.
DATE [date]

Type DATE without parameters to display the current date setting anda prompt for a new one. Press ENTER to keep the same date.

del Delete (Erase) Files
Deletes one or more files.
DEL [drive:][path]filename [/P]
ERASE [drive:][path]filename [/P]
[drive:][path]filename Specifies the file(s) to delete. Specify multiple files by using wildcards.
/P Prompts for confirmation before deleting each file.

Note: In most cases the file is NOT actually "erased"; the space it usedis simply noted as being available for new files to write over it. If youreally want to erase every word of a sensitive file, you should get a'security program' designed to overwrite all erased files!

dir Directory Listing-------
Displays a list of files and subdirectories in a directory.

DIR [drive:] [path][filename] [/P] [/W] [/A[[:]attributes]]
[/O[[:]sortorder]] [/S] [/B] [/L] [/V]

Specifies drive, directory, and/or files to list.

(Could be enhanced file specification or multiple filespecs.)

/P Pauses after each screenful of information.
/W Uses wide list format.
/A Displays files with specified attributes.

D Directories
H Hidden files
A Files ready for archiving
R Read-only files
S System files - Prefix meaning not

/O List by files in sorted order.

N By name (alphabetic)
S By size (smallest first)
E By extension (alphabetic)
D By date & time (earliest first)
G Group directories first
- Prefix to reverse order
A By Last Access Date (earliest first)

/S Displays files in specified directory and all subdirectories.
/B Uses bare format (no heading information or summary).
/L Uses lowercase.
/V Verbose mode.

Switches may be preset in the DIRCMD environment variable. Overridepreset switches by prefixing any switch with - (hyphen)--for example, /-W.

Quits the COMMAND.COM program (command interpreter).
If you're in a DOS-Window in Windows, this will close the window!

Locks a drive, enabling direct disk access for an application.
LOCK [drive:]

Note: If you use this command in a DOS-Window, it will only affect the floppy disk drives; Windows™ 95/98 does not allow you to lock a drive directly while it is operating. If you try lock C: , you'll get the errormessage: " Locking operation failed."

md Make Directory-------
-------Creates a directory.
MKDIR [drive:]path
MD [drive:]path

path -------
Displays or sets a search path for executable files.
PATH [[drive:]path[;...]]

Type PATH (without any parameters) to display the current path.
Type PATH ; (PATH space semi-colon) to CLEAR all search-path settings;

this means that DOS will only be able search the current directory.

NOTE: When used in a DOS-Window, these commands ONLY apply tothat particular DOS-Window! (The PATH will not be changed globally.)See the SET command for a similar effect in DOS-Windows, and alsofor a utility ( that will make global changes!

Changes the Windows command prompt.PROMPT [text] text Specifies a new command prompt.Prompt can be made up of normal characters and the following special codes:

PROMPT [text]

text Specifies a new command prompt.

Prompt can be made up of normal characters and the following special codes:

$Q = (equal sign)
$$ $ (dollar sign)
$T Current time
$D Current date
$P Current drive and path
$V Windows version number
$N Current drive
$G > (greater-than sign)
$L < (less-than sign) $B (pipe) $H Backspace (erases previous character) $E Escape code (ASCII code 27) $_ Carriage return and linefeed Type PROMPT without parameters to reset the prompt to the default setting. rd Remove (Delete) Directory-------

Removes (deletes) a directory.
RMDIR [drive:]path
RD [drive:]path

ren Rename File or Directory-------
Renames a file/directory or files/directories.
RENAME [drive:][path][directoryname1 filename1] [dirname2 filename2]
REN [drive:][path][directoryname1 filename1] [dirname2 filename2]

Note that you cannot specify a new drive or path for your destination.

set -------Displays, sets, or removes Windows environment variables.
SET [variable=[string]]
variable Specifies the environment-variable name.
string Specifies a series of characters to assign to the variable.
Type SET without parameters to display the current environment variables.

Note: If you use SET in a DOS-Window to add a variable and string, itwill only affect commands run in that particular window! Unlinke Win NT(which has a DOS 'Environment' Tab), Windows™ 95/98 normally willnot allow you to set global Environment strings while the OS is running:You have to set them in AUTOEXEC.BAT and reboot the system!

time -------Displays or sets the system time.
TIME [time]

Type TIME with no parameters to display the current time setting and a prompt for a new one. Press ENTER to keep the same time.

type -------Displays the contents of text files.
TYPE [drive:][path]filename

NOTE: If there are more than 25 lines in the file, you'll need to pipethe screen output through the DOS External Command MORE in orderto keep all but the last screen from flashing past you!

EXAMPLE: C:\>type tips.txt more

unlock-------Unlocks a drive, disabling direct disk access for an application.

UNLOCK [drive:]

ver Version-------Displays the Windows version.

vol Volume Label/SN-------Displays the disk volume label and serial number, if they exist.

VOL [drive:]

Note: The DOS command to change a Volume Label is an "External Command"(the program is: LABEL.EXE).

Useful FTP Commands

Attempts to start anonymous FTP session on remote Computer Science server. Enter ftp for userid and your bulldog email address for password. Note: Before attempting to upload files, remember to cd to appropriate dropoff directory as shown below.

Attempts to start FTP session on remote Computer Science server You will need to provide your CSCI userid and password for this host. Note: This command connects you to your own home directory, not the site used for making dropoffs.

ftp> ascii
FTP command to set data transfer mode to ASCII (default, suitable for .java source files and other textfiles)

ftp> binary

FTP command to set data transfer mode to binary (suitable for .class files and other binary files)

ftp> status

FTP command to display status, including current data transfer mode (ASCII or binary)

ftp> cd pub/202/fred1234

FTP command to change current directory on remote host

ftp> lcd examples

FTP command to change current directory on local system

ftp> put

FTP command to copy file from current directory on local system to current directory on remote host

ftp> mput *.java

FTP command to copy all files ending with .java from current directory on local system to current directory on remote host

ftp> quit

FTP command to end session, breaks contact with remote host

MS-DOS Commands for Manipulating Environment Variables


Displays current value of PATH environment variable (list of directories containing DOS command programs)

set path=C:\jdk1.3.1\bin;%PATH%

Adds Java SDK system directory C:\jdk1.3.1\bin to current PATH environment variable (applies only to current session).