Exercise #1 - Using MS-DOS
At the command prompt, enter the DOS commands indicated below to perform the following:
- To change to the DOS directory.
cd \DOS
- To view a list of the files in the DOS directory.
dir
- To view a list of the files in the current DOS directory - one screen at a time.
dir /p
- To view a list of the files in the current DOS directory in wide format.
dir /w
- To change back to the ROOT directory.
cd \
- To format a diskette (Ensure that a NEW diskette / ERASEABLE diskette has been
placed in Drive A:)
format a:
- To confirm that you successfully formatted a diskette in Drive A:
dir a:
- To make a system diskette (ie, Create a bootable disk by formatting the disk and placing
system files on the disk - IO.SYS, MSDOS.SYS, COMMAND.COM).
format a: /s
- To confirm that you successfully created a system diskette.
attrib a:\*.*
- To make the floppy disk drive the current disk drive.
a:
- To create a label on a floppy disk.
label a:
- To create a directory named FRUIT - existing off of the ROOT directory.
md \FRUIT
- To create a directory named GRAPES - existing within the FRUIT directory.
md \FRUIT\GRAPES
- To confirm the existence of the directory GRAPES.
dir \FRUIT
- To change to the directory GRAPES.
cd \FRUIT\GRAPES
- To switch back to the FRUIT directory.
cd ..
- To delete the directory GRAPES.
rd GRAPES
- To confirm you successfully deleted the directory GRAPES.
dir
- To change back to the ROOT directory.
cd \
- To view files on Drive C: when drive A: is current.
dir c:
- To view the contents of the DOS directory on drive C: when drive A: is current.
cd \DOS
- To copy a single file - AUTOEXEC.BAT from drive C: to the ROOT directory on drive
A: .
copy c:\autoexec.bat a:\
- To copy the single file - CONFIG.SYS from drive C: to the ROOT directory on drive A: .
copy c:\config.sys
- To copy the CONFIG.SYS file on drive A: to the another file on drive A: havng the name
workfile.tmp .
xcopy config.sys workfile.tmp
- To confirm the existence of the files on drive A:.
dir
- To move all files with the filename WORKFILE to the sub-directory FRUIT .
move workfile.* \fruit
- To attempt to remove the directory FRUIT.
rd FRUIT
- To confirm the existence of the files on drive A: in the directory FRUIT.
DIR FRUIT
- To delete the directory FRUIT along with ALL files and sub-directories contained in this
directory.
DELTREE FRUIT
- To make a directory WORK on the ROOT of drive A:.
MD WORK
- To copy multiple files from drive C: to the directory WORK directory on driveA:.
xcopy c:\*.* a:\work
- To make the WORK directory on drive A: the current directory.
cd WORK
- To confirm that the WORK directory is the current directory.
DIR FRUIT /p
- To rename the files in the WORK directory to have the existing filename, but for ALL
files to have the extension .TXT.
ren *.* *.TXT
- To rename a single file - COMMAND.TXT to COMMAND.COM.
rename command.txt command.com
- To rename multiple files starting with the letter C to start with the letter X and to have
the extention .DKA.
ren C*.* X*.DKA
- To confirm the existence of multiple files starting with the letter X, and having an
extension starting with the letter C.
dir x*.c??
dir x*.c*
- To delete multiple files having the extension .TXT
del *.txt
- To confirm the existence of the files in the current directory.
dir
- To hide ALL file having an extension starting with the letter C.
attrib +h *.c*
- To delete ALL files existing in the directory WORK.
del *.*
- To list the files in the directory WORK.
dir
- To return to the ROOT directory of the current drive.
cd \
- To attempt to remove the directory WORK.
rd work
- To return to the WORK directory.
cd work
- To list the file in the WORK directory.
dir
- To list ALL files in the directory WORK - including hidden files.
attrib *.*
- To make the hidden file VISIBLE in the directory WORK.
attrib -h *.*
- To list the file in the WORK directory.
dir
- To make ALL files READ-ONLY.
attrib +r *.*
- To confirm the all files are READ-ONLY.
attrib *.*
- To attempt to delete all files in the current directory.
del *.*
- To list the file in the WORK directory.
dir
- To remove the READ-ONLY attribute on all files.
attrib -r *.*
- To confirm the all files are READ-ONLY.
attrib *.*
- To delete all files in the current directory.
del *.*
- To confirm all files have been deleted from the WORK directory.
attrib *.*