Computer Fundamentals And Computing Software (BCA) 1st Sem Previous Year Solved Question Paper 2022

Practice Mode:
7.

Explain the following DOS Commands. Give example to show their use.

(i) PATH
(ii)ATTRIB
(iii)DELTREE

Explanation

PATH Command:

The PATH command in MS-DOS and Windows allows you to set the search path for executable files. It specifies directories where the operating system should look for executable files when you run a program without specifying the full path.

Example:

To add a directory "C:\NewProgram" to the PATH, you can use the following command:

PATH %PATH%;C:\NewProgram

ATTRIB Command:

  • The ATTRIB command is used to change file attributes, such as read-only, hidden, system, and archive. It can also be used to display the current attributes of a file or directory.

Example: To remove the read-only attribute from a file named "example.txt," you can use the following command: ATTRIB -R example.txt

DELTREE Command:

  • The DELTREE command was used in older versions of MS-DOS and Windows to delete directories and all their contents, including subdirectories. It was a way to remove directories recursively.

Example: To delete a directory named "OldData" and all its contents, you can use the DELTREE command as follows: DELTREE OldData

These MS-DOS commands have been largely replaced by more modern and user-friendly commands in contemporary Windows operating systems. In newer Windows versions, you would typically use commands like “del” or “rmdir” to delete files and directories and manipulate the PATH environment variable through the Windows control panel.