Command Prompt (Ms DOS) Exercises


Exercise 1
1. Create two new subdirectories labeled: PUBLIC and PRIVATE in the C:\Work directory. Create two subdirectories labeled PROGRAMS and DATAS in the PUBLIC directory . Create a subdirectory labeled DOCUMENT in the PRIVATE directory.
2. In the DOCUMENT directory create a text file named mylive.txt, and write your firstname, lastname, birth date in this file.
3. Copy the file mylive.txt to the DATA directory.
4. Rename the file from mylive.txt to your lastname, for example: kowalski.txt.
C:\ WORK\ PUBLIC\ PROGRAMS\
DATA\ kowalski.txt
PRIVATE\ DOCUMENT\ mylive.txt.txt

Exercise 2
1. From the level of the C:\Work directory create a directory labeled LAB, and then create two subdirectories labeled: LAB2A and LAB3A in the LAB directory.
2. In the LAB3A directory create a subdirectory labeled LAB4.
3. In the LAB2A directory create files: file1.txt and write your firstname and lastname in this file, file2.txt and write the number of your index in it.
4. Place a data from the files: file1.txt and file2.txt into mydata.txt file.
5. Display the contents of the file mydata.txt.
6. Copy the file mydata.txt to the LAB3 directory renaming it to filescal.txt.
7. Rename the file from mydata.txt to mydata.lst.
8. Enable the "read only" attribute for the file filescal.txt.
9. Enable the "hidden" attribute for the LAB4 directory.
10. Enable "read only" and "hidden" attributes for the file file2.txt."
11. Create a directory: C:\WORK\LABOR.
12. Remove the structure from the LAB directory to the LABOR directory, remember about the hidden files and directories and the empty directory.
13. Place the information about the structure of the C:\WORK directory in the file inflab.txt, and the information about the attributs of this structure in the file infolab2.txt.
14. Delete the tree of the C:\WORK\LAB directory.
C:\ WORK\ LAB\ LAB2A\ file1.txt
file2.txt
mydata.txt
LAB3A\ LAB4A\


Exercise 3
Create a batch file kat.bat that creates the structures of the directories presented on the picture in the current directory, and displays the message: "Directories created".