1-2 OS Fundamentals part 2

Windows 2000

BOOT.INI Contains information that NTLDR reads on how to load win 2000 The BOOT.INI file has two sections, boot loader and operating systems.

BOOT.INI contains the information that you see on the bootstrap loader screen , and if you have more than one OS gives you the choice of which OS to start.

REGEDT32 (32-bit) win 2000 registry editor and is installed in the systemroot\system32 folder.

REGEDIT win 9X registry editor, installed in the systemroot folder. REGEDIT is included with 2000 primarily for its search capability. You can use it to make changes in the registry, but not all functions or data types can be viewed or edited properly. Microsoft recommends that you use REGEDIT.EXE only for its search capabilities and that you use Regedt32.exe when it is necessary to edit the registry.

REGEDIT does not provide the following functions or capabilities:

  • cannot set the security for registry keys.
  • cannot view or edit the value data types REG_EXPAND_SZ and REG_MULTI_SZ.
  • RUN
    CMD
    Click start button choose run type program you want to run
    or use the browse button.

    Win 2000 also has a command called RUNAS, which allows a user to run specific tools and programs with different permissions than the user's current logon provides.

    Syntax : RUNAS [/profile] [/env] [/netonly] /user:UserAccountName program

    Parameters:

  • /profile Name of the user's profile.
  • /env Specifies that the current network environment be used instead of the user's local environment.
  • /netonly Indicates that the user information specified is for remote access only.
  • /user: UserAccountName Name of the user account under which to run the program. Format should be user@domain or domain\user.
  • program The program or command to run using the account specified in /user.
  • NTLDR
    is the bootstrap loader for win 2000 , and is responsible
    for the following operations

  • Enabling the user to select an operating system to start.
  • Loading the operating system files from the boot partition.
  • Controlling the operating system selection process and hardware detection prior to the Windows 2000 kernel initialization.
  • NTLDR
    and the following files must be in the active partition of your hard
    drive.

  • Ntdetect.com
  • BOOT.INI
  • Bootsect.dos (if you plan to boot more than one operating system on your computer)
  • NTDETECT.COM
    detects installed hardware during the win 2000 startup
    sequence. It passes this information to NTLDR and places a list in
    the registry. Ntdetect.com detects the following components:

  • Computer ID
  • Bus/adapter type
  • SCSI adapters
  • Video adapters
  • Keyboard
  • Communication ports
  • Parallel ports
  • Floppy disks
  • Mouse/pointing device
  • Floating-point coprocessor
  • NTBOOTDD.SYS
    Needed only if you are using
    a SCSI-controlled boot partition, and the SCSI adapter does not have
    a SCSI BIOS enabled.

    Command Prompt Procedures (Command syntax)

    DIR Displays a list of files and sub directories in a directory.

    Syntax: DIR [drive:] [path] [filename] [/Switches]

    Switches:

  • /A all (including hidden and system) files and sub directories in the specified directory are displayed.
  • /S Displays files in the specified directory and all its sub directories
  • /W Wide list format. File and directory names are listed in 5 columns
  • /B Bare format. Files and directories are listed in a single column without header, summary, or any details.
  • /L Output is in lowercase.
  • /P Pauses with each screenfull of information. Press any key to see the next screen.
  • /V Verbose mode. This displays attributes, date last accessed, and disk space allocated for each file, in addition to the standard information.
  • ATTRIB
    Displays or changes file attributes.

    attrib [+r|-r] [+a|-a] [+s|-s] [+h|-h] [[drive:][path] filename] [/s[/d]]

  • +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 file as a system file.
  • -s Clears the system file attribute.
  • +h Sets the file as a hidden file.
  • -h Clears the hidden file attribute
  • VER
    Displays OS version , VER /r also displays revision
    and if DOS is in HMA.

    MEM Displays information about allocated memory areas, free memory areas, and programs that are currently loaded into memory in DOS subsystem

    mem /program or mem /p

    /program Displays the status of programs that are currently loaded into memory




     

    SCANDISK Is a utility that checks your hard disk for logical (lost clusters, cross-linked files, directory structure) and physical errors on the drive. Scandisk can then repair the damaged areas. All window versions except NT come with scandisk. If you are using win 3.1 you have to exit to DOS and use its version.

    If you do not shut down the computer properly win 95 OSR2 and 98 will run the DOS version of scandisk automatically next time you start up your computer.

    Win 9x provides two versions of Scandisk: a graphical windows-based version Scandskw.exe and an DOS-based version Scandisk.exe. No matter which version name you type while in windows, either from the run box or a DOS prompt the windows version will run, you must exit to DOS to run its version.

    DEFRAG Starts Disk Defragmenter which rearranges files and un used space on your hard disk so that programs run faster.

    Files are stored in clusters and over time, as programs read and write to a hard disk, these clusters can become fragmented, that is spread throughout the drive. Causing the hard disk to jump all over the drive to read and write data. What defrag does is realign these clusters in sequence, so programs will load faster.

    In windows 98 Defragmenter also uses a process called Task Monitor which automatically monitors programs you use and records their disk access patterns, and number of times these programs are used. This information enables Defragmenter to favor more frequently used programs in optimizing the disk.

    When running Defragmenter you should always close all programs, and disable any screen savers.

    Windows 2000 automatically optimizes disk use. To optimize a disk manually, right-click it in My Computer, click Properties, and then, on the Tools tab, click Defragment Now.

    EDIT Starts Dos-based ASCII text editor.

    Syntax: EDIT [/B] [/H] [/R] [/S] [/nnn] [file]

  • /B Forces monochrome mode.
  • /H Displays the maximum number of lines possible for your hardware.
  • /R Loads file in read-only mode
  • /S Forces the use of short filenames.
  • XCOPY
    Copies files and directory trees. XCOPY is similar to the
    COPY command except that it has many more switches that allow considerable
    control over exactly what is copied when using wildcards.

    Syntax: XCOPY source [destination] [/Switches]

  • /E Copies the complete sub directory structure of source and all files therein.
  • /S Copies the complete sub directory structure of source and all files therein but does not copy empty sub directories
  • /T Copies the sub directory structure of source but does not copy any files and does not copy empty sub directories To include empty sub directories, use with the /E switch.
  • COPY
    Is used to copy one or more files to another location.

    Syntax: COPY source [destination]

    SETVER Some MS-DOS-based applications require a specific version of MS-DOS to be running. This file responds to applications that query for the version number and sets the version number required. This command is usually put into config.sys, but is now incorporated into the windows IO.SYS file.

    Example of line in config.sys. device=c:\windows\setver.exe

    SCANREG Runs the Registry Checker program, which scans your registry. If Registry Checker notices a problem, it automatically replaces the registry with the backup copy.

    Windows comes with a DOS version Scanreg.exe located in \windows\command and an windows version Scanregw.exe located in \windows

    Command line options for Registry Checker

    To restore the backup manually

  • Restart in DOS mode
  • Type scanreg /restore
  • Select latest backup
  • ScanReg
    and ScanRegW

  • /backup Backs up the registry with no prompts to the user.
  • /comment= Specifies that a comment is attached to the backup, which is displayed with /restore
  • ScanRegW
    only

  • /autoscan Scans the registry files every time it is run, but only backs up once per day.
  • /scanonly Scans the registry files and returns an error level. Does not back up.
  • ScanReg
    only

  • /restore Displays a list of backup files available, sorted by date and time of the backup
  • /fix Repairs the registry files
  • Error Codes

  • 2 The registry is bad
  • 0 No problems found
  • -2 Not enough memory; free some memory
  • -3 File not found; one or both of the registry files are missing
  • -4 Unable to create User.dat or System.dat
  • -5 Reading the registry failed
  • -6 Writing to the registry failed
  • -7 Sharing violation (protect mode only); another application has the registry open