Search This Blog

Showing posts with label DOS. Show all posts
Showing posts with label DOS. Show all posts

ATTRIB: Understand Your Computer

In Windows, files and folders have certain properties (called attributes) that can be configured. If you right-click on the file or folder's icon, you'll see some check boxes that allow you to change these attributes. The ATTRIB command allows you to do this when the Windows GUI is not available. The possible attributes, which vary based on Windows version and other factors, are as follows:
Read only: When set, this allows the file to be opened and viewed, but not changed or deleted.
Archive: This attribute affects whether the file will be backed up in certain backup schemes using a backup program, or whether running the XCOPY command will copy that particular file. For more information, see Windows Backup help files.

System: This indicates that the file is necessary for some Windows process.
Hidden: Windows hides certain files by default; however, any file can be hidden or displayed by changing this attribute. In 2000 and XP, when the user has enabled the showing of hidden files (in any Windows folder in Tools > Folder Options > View tab), icons for hidden folders and files appear translucent.

The most common repair use for the ATTRIB command is to replace corrupted registry files in 9x).
When run without switches, ATTRIB shows the attributes of each file in the current folder.
ATTRIB displays, sets, or removes the read-only, archive, system, and hidden attributes assigned to files or folders. Used without parameters, ATTRIB displays attributes of all files in the current folder.
Use
ATTRIB uses the plus sign (+) to turn on an attribute, and the minus sign (-) to turn off an attribute. To use ATTRIB, navigate to the folder where the desired file is located, and type the command followed by the filename (with or without wildcards) and the desired parameters and switches.
Parameters:
+r: Sets the read-only file attribute.
-r: Clears the read-only file attribute.
+a: Sets the archive file attribute.
-a: Clears the archive file attribute.
+s: Sets the system file attribute.
-s: Clears the system file attribute.
+h: Sets the hidden file attribute.
-h: Clears the hidden file attribute.
Switches:
/s: Applies the command to matching files in the current folder and all its subfolders.
/d: Applies the command to the entire folder.
Note:
To apply a change to a group of files using wildcard characters, files with their system and/or hidden attributes will not be affected unless you turn off the hidden and system attributes first.
Examples:
To display the attributes of a file named chapter07.doc, navigate to the folder and enter:
ATTRIB chapter07.doc
To assign the read-only attribute to the file, enter:
ATTRIB +r chapter07.doc
To remove the read-only, hidden, and system attributes from all .reg files on the C: drive, including in all subfolders, navigate to the C: drive and enter:
ATTRIB -r -h -s *.reg /s

CHKDSK: Understand Your Computer

CHKDSK (present in all versions, useful in 2000 and XP only)
CHKDSK is a program used for checking the status of magnetic drives/disks, fixing certain errors, and even recovering readable data from bad disk sectors. It isn't particularly useful in 9x, except for obtaining a report on files on the disk. To correct any disk errors on 9x, run ScanDisk. In 2000, and XP, CHKDSK replaces 9x's ScanDisk. In 2000 and XP, it is easier to run CHKDSK from Windows, so you might as well save the command-line version for when the computer is booted into Safe Mode, Command prompt only. When invoked with the /f and/or /r switches to run on a disk in use, CHKDSK will prompt you to run at the next boot.
Use
Type CHKDSK followed by the drive letter and colon (:), followed by any switches (each switch must be preceded by a space character).
Switches
/c: Use with NTFS-formatted drives only. Skips folder structure cycle checking, resulting in a faster completion.
/f: Fixes file system errors on the disk. If run on a disk currently in use, /f causes CHKDSK to be run on the next boot.
/i: Use with NTFS-formatted drives only. Performs a less exhaustive check of index entries, resulting in a faster completion.
/r: Recovers readable information from bad disk sectors. If run on a disk currently in use, /r causes CHKDSK to be run on the next boot. See the listing for the RECOVER command for another tool that can recover lost data.
/v: Displays the name of each file in every folder as the disk is checked.
/x: Use with NTFS-formatted drives only. Makes all necessary changes to any network-mapped drives in order for CHKDSK to work on them. /x also includes the functionality of the /r switch.
Notes
· Running CHKDSK without the /f, /r, and/or /x switches is usually pointless and might report false disk errors.

· If you are prompted to convert lost chains (unidentified file fragments) to files, do so by typing . You can then find the files in the root folder (C:\ in the C: drive). The files are named File****.chk (the asterisks stand for any character). If the files don't contain any data you need, you can delete them. If you type (answer no) to the prompt, the fragments will be deleted automatically.If you use the /f or /x switch on a very large disk such as 80GB, or one with huge numbers of files (e.g., millions of files), CHKDSK might take several days to complete. CHKDSK cannot be stopped while it is running, so the computer will not be available for this time.

Q. how to Configruing with Config.sys and Autoexec.bat files

Configruing with Config.sys and Autoexec.bat files

CONFIG.SYS is an ASCII file that contains instructions to DOS for making best of your system's recources.


The AUTOEXEC.BAT file is an ASCII file that contains a series of DOS line commands which will be invoked, in sequence automatically at startup time. Although is can contain any command that can be validly invoked its purpose is to invoke additional configuration commands and start up programs that you would other wise invoke yourself each time you started your computer.

Multiple configuration

There is feature that allows you to write CONFIG.SYS so that you can choose among multiple configurations at startup time. For example consider RAM disk. A RAM disk is special area of random-access memory that appears to the operating system to be another disk drive. Its advantage is that it is faster than physical disk drive or more convenient for storing temporary files. RAM disks are initialized using CONFIG.SYS.

There may be times when you want a RAM disk and other times when you would prefer not to use up valuable RAM that might be better used by one or more of your applications. You would be required to edit the CONFIG.SYS file and restart you computer and choose whether or not to include the RAM disk. Before attempting to rewrite you CONFIG.SYS file to support multiple configurations, you must be familiar with standard CONFIG.SYS syntax and use driver files. Multiple configuration CONFIG.SYS file utilizes this fundamental syntax plus some additional elements; menu blocks, configuration blocks, directives, and common block.

The general structure of a multiple-configuration CONFIG.SYS file is all follow:

(a) A sequence of required commands if any that must be invoked first, regardless of
which option is to be selected.

(b) An initial menu block, always named {menu}, containing up to nine configuration
choices for use.

(c) Any number of configuration blocks, that contain commands referenced in optional
configuration blocks.

(d) The series of optional configuration blocks, containing the commands required for each
optional selection from the menu.

(e) A final common configuration block, always named {common} which is the last
configuration block in the file. This block contains configuration commands that are always invoked, regardless of which option is chosen, but must follow the optional configuration blocks in the file.

In addition, a multiple-configuration CONFIG.SYS file may contain submenus. A submenu is another configuration block with a unique block neme that contains additional menu commands. It is referenced like any other configuration block but functions like additional, nested menu, use submenus if you require more that nine optional configuration or if you feel that submenus organize your possible choices more logically that single menu.

The program Listing shown below is a simple multiple-configuration CONFIG.SYS file that demonstrates a typical structure. The elements in this file are explained more fully in the following paragraphs.

Rem ** these commands are used by all options:
DEVICE=C:\SW\COMMAND\HIMEM.SYS
(note:- instead of command if you are running DOS (Disk Operating System) you can use \DOS)
DOS=HIGH
Rem ** this is the configuration menu:
[menu]
MENUCOLOR=15,1
MENUITEM=ramsisk1, RAM disk (1024mb)
MENUDEFAULT= noramdisk, 15
Rem ** this is the configuration block for initialization
DEVICE=WIN.EXE RAM HIGHSCAN
Blog Widget by LinkWithin