1. Date and hours - 2. Utilities hard drives and diskettes - 3. Backup and restore - 4. Utilities for partitions - 5. Attrib - 6. Other commands
The previous chapter analyzed file manipulation commands. This training will or even specific controls systems (computer configuration, check the hard disk). Found the controls Dates and times, check the hard disk, formatting and creating partitions.
Two commands are used to change the date and time. It directly manages the system's BIOS. The XT lacked circuit RTC (Real Time Clock), the clock was not updated if the computer was not under voltage. This is no longer the case since the 286.
The use of these 2 commands in a DOS window is perfectly identical to the Setup on Windows by the control panel or in the BIOS directly.
c:\>TIME: displays and allows you to update the system time |
By directly pressing enter, time is kept.
c:\>DATE: displays and allows you to update the system time |
By directly pressing enter, the date is preserved. To update the date, enter the current date. The format differs from the language of the operating system. DOS is not Y2K compatible. A 1906 file date is equivalent to a file from 2006
This command is created only from DOS 5.0. The options are changed in the current Windows DOS.
c:\>CHKDSK <Drive>: checks the specified
disk
The report contains:
|
The number of sectors (clusters) unusable results of the different entries of files on the disk, these sectors are included in the table of contents (FAT) in a way incorrect and recoverable by general rule programs. A sector may also be defective by failure on the hard disk and unusable. The command CHKDSK /F arranges clusters and retrieves the fragments of files (*.chk) text files. These files can be deleted. This command is executed (in graphic mode) by Windows 95 et next (FAT partitions) if the system has not been closed properly (power failure).
This command allows to format (prepare) the surface of a hard disk or a floppy disk.
c:\>FORMAT Drive: formats the disk <drive>
The information contained on the hard disk or floppy disk is lost, except in some cases with the Unformat command in DOS 6.0, 6.0, 6.2, and 6.22 |
c:\>FORMAT /S <drive> formats disk and inserts the system startup files |
DOS up 6.22 version accepts only with a maximum size of 2 GB FAT partitions. The default keyboard is QUERTY, must be also use command into files config.sys and autoexec.bat with the appropriate command.
c:\>FORMAT /U <drive> format the disk and ensures better recovery when ordering Unformat (versions 5.0 to 6.22) |
c:\>FORMAT /V: <label><disque>formats disk and gives as the name label. |
The name of the volume can also be registered using the VOL command below. DOS does not accept accented characters or spaces.
c:\>FORMAT /F: <size> <disk name>; formats the disk using a defined format. By default, formatting uses the default format. <Size>can take the following
values:
|
c:\>FORMAT /B :< diskette name > formats the disk and reserves the place to insert the system files later |
This command is recognized only from DOS 5.0. A format/U command allows better recovery. This works only if the floppy disk or the hard disk clusters have not been used by a new file since. It no longer exists in Windows.
c:\>UNFORMAT < disk name >: presents the old formatting, including files under certain conditions |
c:\>LABEL <disk name>: gives a label (name) to the specified disk. |
DOS does not recognize accented characters, or spaces. To display the name of the label, used the VOL command.
c:\>VOL <disc>: displays the label of the disc created by the LABEL command |
c:\>FDISK: allows to create, edit, or delete partitions on hard disks. |
DOS only accepts 2 GB max FAT partitions. Higher versions accept partitions VFAT (still 2 GB) or FAT32 (Wn95B and above). This command is no longer used. This order is taken again under DOS for the operating systems Wn95/98 and Millenium. In the case of XP, 2000 and NT, it is accessible only during the installation with a different interface. In practice, you can create partitions with Win98 and re-use them for other operating systems. It is preliminary to the FORMAT command and erases the data completely!
The partitions are software cuttings of the hard disks. The first accessible letter for a hard disk is C:, then D: and so on. The readers CD come then (except Win2000 and XP where one can modify the letters then).
As of starting, FDISK asks whether it must use readers of great capacity (FAT 32 - hard disks of more than 2 GB), the answer is YES
The following menu appears.
To create a partition under Win 95/98/Me
This order makes it possible to create partitions: by disc an obligatory principal partition and an optional wide partition (if one wants to cut the discs in segments). When a principal partition is created, FDISK proposes to use all space. If you choose YES, only one partition is created and activated automatically. There will be no wide partition. If you choose NOT, FDISK will propose a size for this principal partition to you and you will be able to create a secondary partition after.
When you create the secondary partition, FDISK automatically proposes to create a wide partition (one or more). You can choose the maximum size (the hard disk has a principal partition then C: and a secondary partition D:). If you do not use the entirety of the extended partition, you can create in this wide partition of other logical readers (E:, F:, ...)
Activate a primary partition.
This order makes it possible to use a primary partition as partition of starting (automatic if you create only one partition). In the case of Windows 95/98/millenium, it is obligatorily a principal partition.
If no partition is activated, the operating system, even installed, will not start starting from the hard disk.
To delete partition
This order makes it possible to remove partitions create. You must obligatorily start with the readers, then by partition DOS extended, then by the primary partition. But you are not obliged to erase all.
Hard drive selection.
This order appears only if several hard disks are connected in the PC. A small remark. If you use the order FORMAT under Win95/98/Millenium
c:\>DISKCOPY <source disk> < destination disk>: copies the contents of the source (including formatting) floppy disk to the destination disk. |
c:\>DISKCOPY <source disk> <destination disk> /V: Additionally verifies the copied data. |
This command is not for Hard disk. The diskcopy a: a: command is also accepted if you use only one floppy drive.
The 2 following commands to back up and restore files and directories on disks. They are most recognized by the current Windows. Significantly more efficient software are preferable. Starting with version 6.0, this command no longer exists, replaced by MS-Backup (Symantec purchased software license). It uses the archive bit.
c:\>BACKUP <path>
< file name> < drive>/A/S/M/D: <date>: backup diskette (s) file (s) specified (s) in a single file (backup.001) and uses a control file (control.001). If the backup uses multiple disks, the second will take extension
002...
|
The date of creation is that to the what the file was actually created, not that registration on the hard disk. If the file size is too large, DOS asks to insert a new and changes the extension of the file on the next disk.
Example 1: c:>backup a:/s backup all the files on the hard drive C: (including subfolders) to the floppy A
Example 2: backup c:\DOS A: /A /M backup all files in the DOS folder modified since the last backup.
Example.3: backup d:\*.exe b:/S /D:07/01/95 backup all files from the hard disk D: (including subdirectories) whose extension is EXE and whose creation date is greater than 07/01/95.
This command (up DOS 5.0) to retrieve files saved with the BACKUP command. For superior versions, MS-backup enables the restoration.
c:\>RESTORE <lecteur> <disque> <chemin> <nom-fichier-a-restorer> /S /P /N /M
|
The majority of the technicians use specific software to modify partitions as the conversion of FAT (VFAT and FAT32) to NTFS or even cut a physical disk into several partitions. However, since Windows XP (it works also in Windows 7) commands are directly integrated into Windows... or rather DOS commands are listed under Windows.
The first use is actually the conversion of FAT (all versions combined) to NTFS partitions but other options are clearly more useful as the deletion on the set of a partition of a hard disk of the security settings. In Vista and Seven, start the command prompt in administrator mode via the pop-up button (the list of commands accessible with the right button of the mouse in the list of programs).
c:\>CONVERT <Volume>
|
DiskPart is not quite a command but well a utility in the direction where run it opened (still in DOS) a utility (use the EXIT command to exit). We will meet in the recovery console. For ordinary technicians, this command is a kind of partition-magic but for technicians, it allows considerably more opportunities, including repairs of damaged RAID 5 structures.
To start, in a command prompt window, just type diskpart (at this point, there are no options), again, the administrator mode is desirable from Vista.
c:\>c :> ATTRIB [-/ + R] [-/ + S] [-/ + H] [-/ + A] /D /S [drive:] [path]
file. The wildcards * and? are accepted in the name of the file.
|
This command allows for example to view for editing the file hidden Boot.ini in the root of a Windows 2000, XP... (except Vista and later).
Usage example: attrib-r-s-h boot.ini
c:\>VER displays the current DOS version |
This command is used primarily by external software, for compatibility issues. It is known by all versions.
c:\>sys [1 drive] [path 1] [drive 2] transfers files systems from drive 1 to the drive2 |
This command is used to make system a hard disk or a floppy disk. For example: sys a: c: transfers the system files (make bootable) the hard drive. The start A: floppy disk must be bootable. The version of the operating system transferred is the same as floppy disk.
c:\>mem: displays the amount of memory present in the computer |
This command works on all operating systems, including Windows XP or Seven, but does recognize that 1 GB max (the maximum size in DOS). It is more than useless.