Sistemi operativi - DOS - Astuzie Sistemas de exploração - COSTAS - Astucias Betriebssysteme - DOS - Tipps Systèmes d'exploitation - DOS - Astuces Sistemas operativos - DOS - Consejos

Setting the CD-ROM drive

The CD-ROM drive is configured in the config.sys and autoexec.bat system files. The CD-ROM drive device driver must be configured in the config.sys file (even if the device is automatically detected in Windows). To do this, copy the device driver to a folder on the hard drive (in the following example it is called cdrom.sys located in the "cd-rom" folder). Next you must add the line:

DEVICE=c:\cd-rom\cdrom.sys /d:CD001

(CD001 is the name you give to the CD-ROM drive...)

Next the CD-ROM controller (called mscdex.exe must be added to the autoexec.bat by adding the following line:

c:\windows\command\mscdex.exe /d:CD001

(Where CD001 is the name given to the CD-ROM drive and the drive letter that is assigned to the drive is the next letter available, so if you have hard drives D: and E:, and F: is free, then the CD-ROM drive will be assigned the letter F:. If you want to specify the letter to be assigned use the /L:Z option for example.)

Copying a file

There are to commands used to copy files in DOS: copy and xcopy.
Xcopy is the most useful, and is uses the following syntax:
xcopy source destination (where "source" is the filename and "destination" is the filename or folder name where the file is to be copied)

The entire contents of a folder can be copied by typing the name of the folder for "source". The destination must therefore be the name of a folder, it would be rather difficult to copy a folder (i.e. a group of files) into one single file!
The "/s" switch is used to copy sub-folders:
xcopy folder1 folder2 /s copirs folder1 to folder2.

Running a program from any folder

The "PATH" environment variable lets you set the folders whose contents may be accessed even if you are working from a different folder.
Syntax is as follows:

PATH=c:\dos;c:\utils;

The files located in the C:\dos and C:\utils folders may be executed regardless of which folder you are working from. If you have already specified the folders in the environment variable and you wish to add another, you can use the following command:

PATH=%PATH%;c:\folder;

which will add the folder C:\folder to the existing PATH (%PATH%)

The PATH variable has a 127 character limit as the name of variable PATH and the equal sign take up 5 characters already, there are only 122 characters left to specify the folder names

Tip to use this variable effectively make sure to:

  • remove any spaces in the path command
  • delete any rarely accessed folders
  • give folders the shortest name possible

Mapping a folder to a drive letter

Mapping a folder to a virtual drive can be done using the subst command.
The syntax for the command is as follows:

subst f: c:\example

The folder C:\example will then be accessible as a virtual drive with the letter "F:". This implies that the F: drive is not already assigned to a drive, if so the system returns the error message "syntax error 10". You must change the target drive letter...

Modifying file properties

A file may have several properties which dictate how that file can be used. These properties can be activated or deactivated in DOS using the attib command.
The syntax for the command is as follows:

attrib +/-a +/-h +/-s +/-r

where + and - activates or deactivates the attribute which follows.

  • a: archive attribute
  • h: hidden file attribute (the file remains hidden in normal file view)
  • r: read-only file attribute (the file cannot be deleted without deactivating this attribute)
  • s: system file attribute (important files which must be treated with care)

"attrib config.sys -a -r +h" deactivates archive and read-only attributes and hides the file.

Listing files

The dir command is used to list files. The file listing can also be done using several criteria (alphabetical order, date, etc.), these criteria can be applied using the following parameters:

  • /p: fills the screen with the results then pauses the screen
  • /w: displays the results in 5 columns
  • To display files according to various criteria:
    • /ah: displays hidden files
    • /ad: displays folders only
    • /ar: displays read-only files
    • /aa: displays files ready to be archived
    • /as: displays system files
  • To display files in a specific order:
    • /ON: sorted by name
    • /OS: sorted by size (ascending)
    • /OE: sorted by extension
    • /OD: sorted by date
    • /OG: sorted by parent folder
    • /OS: sorted by attribute
  • /s: displays the files located in a folder and all sub-folders
  • /b: minimal view
  • /l: displays results in lowercase
  • /v: displays additional information

Using wildcard characters

For a command that runs on files, instead of giving a file name you can use the wildcard characters when specifying files whose name begins with certain characters:

  • the wildcard character "*" replaces parts of a name or an extension
  • the wildcard character "?" replaces a character (like the blank tile in scrabble)

Thus the command "dir *.com" lists all files with the .com extension.
The command "dir b*.*" returns all files whose name begins with b.

How to send the displayed results to a file

Using the redirect parameter (> or >>) you can send the results of a dir command to a file:
The "dir >> test.txt" will send the list results to the test.txt file which will be created in the current directory if it does not already exist, or if it does exist the new file name will be concatenated (a number added to the end of the existing file).

Last update on Thursday October 16, 2008 02:43:13 PM.This document entitled « Operating Systems - MS-DOS - Tips » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.

Best answers for « Operating Systems MS DOS Tips » in :
Operating Systems - MS-DOS - Commands Show Command Description dir lists the contents of a folder cd changes folder cd .. parent folder md or mkdir creates a new folder deltree deletes a folder and all sub-folders copy, xcopy copies...
Operating Systems - Installing MS-DOS Show Installing MS-DOS When installing MS-DOS, make sure that in the BIOS the the boot disk is set to A: first, then the hard drive (boot sequence: A:, C:) Then insert disk 1 in the A: drive, power up the computer, then follow the on-screen...
MS DOS Files and directories Show Files in MS DOS In a computers data is stored in files. When you run a program, MS-DOS processes the data stored in the file and passes it to the system. In MS-DOS a file can be any size, however the file name is more restricted, it can only have...
VISTA ERROR: MS-DOS FUNCTION INVALID ShowVISTA ERROR: MS-DOS FUNCTION INVALID Solution When trying to delete a file, Microsoft Vista display the following error message: Copy the file - An unexpected error fails operation. Note that the error code, which can help you...
Basic MS-Dos commands ShowBasic MS-Dos commands Intro The command prompts: Intro Here is a list of basic commands that you can use in a DOS prompt (e.g. a using a boot disk). To have additional information about these commands, type /? after entering the...
[MS-Dos]List the contents of a directory in a file Show[MS-Dos]List the contents of a directory in a file Intro Explanation Intro It may be convenient to make the listing of one or more directories in a file, to make a catalog of files. Under MS-DOS (or Windows by opening a...
Download GAG Graphical Boot Manager ShowGraphical Boot Manager is a management programs. The application is launche when your computer starts up and allows you to choose the operational system which you would like to use. The main features : - the possibility to booter from nine...
Download Dimension ShowDimension 4 is the most practical and quickest resolution to synchronize the clock of your computer for the basic operations of your system. Dimension 4 uses one of the protocols most used by those valid for the general public. The waiter was...
Operating system ShowDescription of the operating system For a computer to be able to operate a computer programme (sometimes known as application or software), the machine must be able to perform a certain number of preparatory operations to ensure exchange between...
Introduction to DOS ShowThe development of MS-DOS MS-DOS is the most well known operating system, the most commercialised version is that of Microsoft, christened "MS-DOS" (there are other versions such as DR-DOS). MS-DOS was created in 1981 when it was used on an IBM...
Operating Systems - DOS - Memory ShowIntroduction to memory Memory is an area where programs are stored and from where they can be executed.A PC compatible computer has three types of memory: conventional extended paged The amount of memory present (and available) in a system can...