Sunday, November 25, 2007

Operating Systems: CMDS for File Access

You want to create a text file. You create the file with a text editor and save it as INFO.TXT.
You want the file to be easily accessible so that anyone can read it, but you want to protect the file so that it cannot be easily edited or deleted.
Which file or utility can you use to do this?

1. REGEDIT.EXE
2. CONFIG.SYS
3. MSDOS.SYS
4. >>ATTRIB.EXE

Explanation : ATTRIB.EXE is a command prompt program that is used to display, add, or change file attributes. You can type ATTRIB +R INFO.TXT to add the Read-Only attribute to the file. In order to edit or delete the file, the Read-Only attribute must be removed using the command ATTRIB -R INFO.TXT. This will not absolutely prevent someone from editing or deleting the file, but extra steps are required to do it.
Other attributes include the following:
* A (Archive): used by backup programs to indicate which files have been changed since the last backup.
* H (Hidden): used to keep a file name from being displayed with the DIR command.
* S (System): designates a file critical to the system startup and operation.

CONFIG.SYS is the DOS system file that contains hardware/driver information and environment settings.

MSDOS.SYS is one of the hidden, necessary files that must be on a boot disk for DOS to initialize.

REGEDIT.EXE is the Windows Registry Information Editor. It makes it easier to edit the keys and entries in the Windows registry.