| MS-Dos See also : |
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.)
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.
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:
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...
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.
"attrib config.sys -a -r +h" deactivates archive and read-only attributes and hides the file.
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:
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:
Thus the command "dir *.com" lists all files with the .com extension.
The command
"dir b*.*" returns all files whose name begins with b.
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).