The console command of WIN XP (including 2000) is a very effective diagnostic and testing tool that appears in the system. Tools for recovering system features. Xiaobian did always want to sum up this command, this time, the hardships gave us this practical secret.
Part 1: File and directory operation command
Attrib Batch Chdir (CD)
Copy Delete (DEL) EXPAND
Mkdir (MD) RMDIR (RD) Type
More
Part II: System and Disk Operation Commands
Bootcfg hkdsk diskpart
FIXBOOT fixmbr Format
Map
Part III: Auxiliary operations and special function orders
CLS Disable Enable
EXIT HELP COMMANDNAME
Listsvc logon net us
Set SystemRoot
Attribact
Change the properties of a single file or directory. This command sets or deletes read-only, system, archive, hidden, and compressed properties assigned to files or directories.
Attrib commands with the following parameters are only available when using a fault recovery console. Attribols with different parameters
The command can be used in the command prompt.
Attrib [ r | -r] [ s | -s] [ h | -h] [ c | -c] [[drive:] [PATH] FileName]
parameter
r Sets read-only properties.
-r Clear read-only properties.
S Set system properties.
-s Clear system properties.
h Set hidden properties.
-H Clear hidden properties.
C Sets the compression properties.
-c Clear compressed properties.
[[DRIVE:] [PATH] FileName]
Specifies the location and name of the directory or file you want to process. You can change only one file at a time or change the entire directory.
Note: You can change multiple properties of a file or directory with a command.
Batch
Perform the command specified in the text file. The Batch command is only available when using the fault recovery console. The fault recovery console can be started from the installation CD.
Batch Input_File [Output_File]
parameter
INPUT_FILE
Specifies the text file that contains the list of commands to be executed. Input_file can be composed of a drive letter and a colon, a directory name, a file name, or a combination thereof.
OUTPUT_FILE
If specified, store the command output in the name file. If not specified, the output will be displayed on the screen.
example
The following example will execute the batch file C: / JOBS / FIND.TXT and store the output in file C: / jobs / result.txt:
BATCH C: / JOBS / FIND.TXT C: / JOBS / RESULTS.TXT
Note: Batch files cannot contain nested BATCH commands.
CHDIR (CD)
Displays the name of the current directory or change the current folder.
The chDIR command containing the following parameters is only available when using the fault recovery console. You can use a chDIR command with different parameters at a command prompt.
Chdir [Drive:] [PATH] [..]
or
CD [Drive:] [PATH] [..]
Parameter
If you do not bring any parameters, ChDIR will display the name of the current drive and folder. Use only with the drive letter (for example, CD C :), chDIR will display the current directory on the specified drive.
[Drive:] [PATH]
Specifies the drive to be changed (if not the current drive) and directory.
[..]
Indicates to the parent folder. Insert a space between chDIR and two stations.
note
· CHDIR regards space as a separator. Use quotes to extend the name of the catalog containing spaces. E.g:
CD "driver cache"
· ChDIR is only applicable to the current Windows installed system directory, movable media, hard disk partition root, or local installation source. Copy
Copy a single file to another location. The copy command containing the following parameters is only available when using the fault recovery console.
You can use a copy command with different parameters at the command prompt.
Copy Source [Destination]
parameter
Source
Specifies the location and name of the file to be copied. Source can be constructed from the drive letter and colon, directory name, file name or combination.
Destination
Specifies the location and name of the file or file set to be copied. Destination can consist of drive numbers and colons, folder names, file names, and combinations.
note
• The source can be a movable medium, any directory, the root directory of the drive, local installation source or cmdcons directory in the current Windows installation system directory.
• The target can be anywhere other than the source other than the source. If there is no target, it is default
Current directory.
• The compressed file in the Windows installation CD is decompressed during the replication process.
· COPY does not support wildcard.
Delete (DEL)
Delete a single file. The delete or DEL command containing the following parameters is only available when using the fault recovery console. You can use the delete or del command with different parameters at the command prompt.
Delete [Drive:] [PATH] FileName
or
Del [Drive:] [PATH] FILENAME
parameter
[Drive:] [PATH] FileName Specifies the location and name of the file to be deleted.
note
· Delete is only applicable to the current Windows installed system directory, movable media, hard disk partition root, or local installation source.
DIR
Display the files and subdirectory lists in the directory. DIR commands with the following parameters are only available when using the fault recovery console. The DIR command with different parameters can be used at the command prompt.
Dir [Drive:] [PATH] [filename]
parameter
[Drive:] [PATH]
Specify the drive and directory to view the list.
[filename]
Specify a specific file or a set of files to view the list. You can use multiple file names. The file name can be separated by spaces, commas, or semicolons. A set of files can be displayed using wildcards (? And *) in the filename parameter.
DIR also lists the volume labels and serial numbers of the disk, as well as the number of the listed files, cumulative size, and the remaining available space on the disk (in bytes). For each file and subdirectory, the DIR lists the extension of the file, the file byte, the last modification date and time of the file, and the following file properties (if available):
Abbreviation attribute
d catalog
h hidden files
S system file
e encryption
r readite
A archive file
C is compressed
p Re-analyzing point
note:
DIR applies only to system directories, mobile media, hard disk partitions, or local installation sources.
Expand
Extract files from the compressed file. The driver file can be extracted from the .cab file or compressed file by this command.
The expand command containing the following parameters is only available when using the fault recovery console. You can use the Expand command with different parameters at the command prompt.
Expand Source [/ f: filespec}] [destination] [/ d] [/ y]
parameter
Source
Specifies the file to be expanded. If the source file contains only one file, use this option. Source can be constructed from the drive letter and colon, directory name, file name or combination. Can't use wildcard.
/ f: size
If the source file contains multiple files, specify the name of the file to extract. You can use wildcards to files to be extracted.
Destination
Specify the target directory and / or file name of the extraction file or each individual file.
/ d
List the files contained in the CAB file without expand or extract.
/ Y
Cover prompt does not appear when expanding or extracting files.
example
The following example extracts the msgame.sys file from the driver CAB file on the installation CD and copy it to C: / Windows / System / Drivers: Expand D: / i386 / driver.cab / f: msgame.sys C: / Windows / System / Drivers
The following example will expand the compressed file Access.cp_:
Expand d: / i386 / access.cp_c: / windows / system32 / access.cpl
The following example lists all files in the driver CAB file on the installation CD.
Expand / D D: / i386 / driver.cab
Point
The driver CAB file contains thousands of files, including most of the drivers provided by Windows. It takes a long time and a large amount of disk space to expand all files from the CAB file to your hard drive. It is recommended to extract the required files from this file.
note
· If there is no target, the file will be copied to the current directory.
· You cannot specify a movable media such as a floppy disk or CD-ROM as a target.
Mkdir (MD)
Create a directory or subdirectory. The mkdir command containing the following parameters is only available when using the fault recovery console. The MKDIR command with different parameters can be used at the command prompt.
Mkdir [Drive:] Path
or
MD [Drive:] Path
parameter
Drive:
Specify the drive to create a new directory.
Path
Specify the name and location of the new directory. Can't use wildcard.
note
· MKDIR applies only to the current Windows installed system directory, movable media, hard disk partition root directory, or local installation source.
Rename (ren)
Change the name of a single file. The rename command containing the following parameters is only available when using the fault recovery console. The rename command with different parameters can be used at the command prompt.
Rename [Drive:] [PATH] Filename1 FileName2
or
Ren [Drive:] [PATH] Filename1 filename2
parameter
[Drive:] [PATH] FileName1
Specifies the location and name of the file to rename. Can't use wildcard.
Filename2
Specify a new name for the file. You cannot specify a new drive or path when renameting files.
RMDir (RD)
Delete the directory. The RMDIR command containing the following parameters is only available when using the fault recovery console. MDIR commands with different parameters can be used at the command prompt.
Rmdir [Drive:] Path
or
Rd [Drive:] Path
parameter
[Drive:] Path
Specifies the location and name of the directory to be deleted. Can't use wildcard.
note
· The directory must fail for the empty command.
• RMDIR applies only to the current Windows installed system directory, mobile media, hard disk partitions root, or local installation source.
Type
Display the contents of the text file. Use the Type or more command to view text files without modifying files. The TYPE command containing the following parameters is only available when using the fault recovery console. You can use the Type command with different parameters at the command prompt.
TYPE [Drive:] [PATH] FileName
or
More [Drive:] [PATH] FILENAME
parameter
[Drive:] Path] FileName
Specifies the location and name of the file to view.
If you use the NTFS drive and the file name contains spaces, you must use quotation marks (") to cause file names.
More
Display the contents of the text file. Use more or type command to view text files without modifying files. More commands with the following parameters are only available when using the fault recovery console. The more command with different parameters can be used at the command prompt.
More [Drive:] [PATH] FILENAME
or
TYPE [Drive:] [PATH] FileName
parameter
[Drive:] Path] FileName
Specifies the location and name of the file to view.
If you use the NTFS drive, and the file name contains space, you must use quotation marks (") to cause file names. Bootcfg
Bootcfg command launch configuration and fault recovery (for most computers, the Boot.ini file).
The bootcfg command containing the following parameters is only available when using the fault recovery console. The bootcfg command with different parameters can be used at the command prompt.
usage:
Bootcfg / default Set the default boot item.
Bootcfg / add to the boot list to add a Windows installation.
Bootcfg / Rebuild Repeats all Windows installation procedures and allows users to select content to be added.
Note: Before using Bootcfg / Rebuild, you should back up the boot.ini file through the bootcfg / copy command.
Bootcfg / scan scans all disks used for Windows installation and display results.
Note: These results are stored in static and used for this session. If the disk configuration changes during this session, for the updated scan, you must restart your computer and then scan the disk again.
Bootcfg / list lists the entries in the boot list.
Bootcfg / disableredirect disables redirects in the boot boot program.
Bootcfg / redirect [portbaudrrate] | [usebiossettings]
Enable redirection by specifying configuration in the boot boot program.
example:
Bootcfg / redirect com1 115200
Bootcfg / redirect usebiossettings
HKDSK
Create and display the status report for the disk. The chkdsk command can also list and correct the error on the disk.
The Chkdsk command containing the following parameters is only available when using the fault recovery console. A Chkdsk command with different parameters can be used at the command prompt.
Vol [Drive:] [CHKDSK [Drive:] [/ P] [/ R]
Parameter
If you do not bring any parameters, CHKDSK will display the disk status in the current drive.
DRIVE: Specifies the drive to check the Chkdsk.
/ p Even if the drive is not in the Check of CHKDSK, it is also performed. This parameter does not make any changes to the drive.
/ r Find bad sectors and restore readable information. Implicit / P parameters.
note
The chkdsk command requires the autochk.exe file. If this file cannot be found in the startup directory (default to /% systemroot% / system32), try to find it in the Windows Installation CD. If there is a multi-boot system, you must ensure that the command is used on a drive containing Windows.
Diskpart
Create and delete partitions on your hard drive. The DiskPart command is only available when using the fault recovery console.
Diskpart [/ add | / delete] [device_name | drive_name | partition_name] [size]
Parameter
If no parameters, the diskpart command will launch the Windows character mode version of Diskpart.
/ add
Create a new partition.
/ delete
Delete existing partitions.
Device_name
To create or delete a partition device. The device name can be obtained from the output of the MAP command. For example, device name:
/ Device / HardDisk0
DRIVE_NAME
The partition is derivated in the drive letter. Only use / delete. The following is an example of the name of the drive:
D:
Partition_name
The partition is represented by a partition name. Can be used instead of DRIVE_NAME. Only use / delete. The following is an example of a partition name:
/ Device / HardDisk0 / Partition1
The partition size to be created, is represented by a megabyte (MB). Only use / add simultaneously.
example
The following example will delete the partition:
Diskpart / delete / device / harddisk0 / partition3
DiskPart / Delete F:
The following example will add a 20 MB partition on the hard disk:
DiskPart / Add / Device / HardDisk0 20
FIXBOOT
Write a new partition boot sector to the system partition. The FixBoot command can only be used when using the failed recovery console.
FIXBOOT [Drive]
Parameter drive
The drive will be written to the boot sector. It will replace the default drive (ie, the user logged in system partition). For example, drive: D:
example
The following command example writes a new partition boot sector to the system partition of the drive D::
FixBoot D:
Note: If no parameters, the fixboot command writes a new partition boot sector to the system partition logged in to the user.
FixmbR
Fix the primary start record of the boot disk. The Fixmbr command is only available when using the fault recovery console.
FIXMBR [Device_name]
parameter
Device_name
To write a new device (drive) for the new main boot record. The device name can be obtained from the output of the MAP command. For example, device name:
/ Device / HardDisk0
example
The following command example writes a new main boot record to the specified device:
FIXMBR / Device / HardDisk0
note
• If DEVICE_NAME is not specified, the new main boot record will be written to the boot device, that is, the drive of the main system.
• If the system detects an invalid or non-standard partition table tag, the user will prompt whether the user continues to execute. Do not continue unless you have a problem with your access drive. Write a new primary boot record to system partitions may destroy the partition table and cause the partition to be unacceptable.
Format
Format the specified drive to the specified file system. The format command containing the following parameters is only available when using the fault recovery console. The format command with different parameters can be used at the command prompt.
Format [drive:] [/ fs: file-system]
parameter
Drive:
Specifies the drive to format. Formatting floppy disks from fault recovery console.
/ Q
Quickly format the drive. Do not scan the driver to see if there is a bad area, so this parameter should only be used for the previously formatted drive.
/ fs: file-system
Specify the file system to use: FAT, FAT32, or NTFS. If the file system is not specified, an existing file system format will be used.
Map
Displays the mapping of the drive letter and the name of the physical device. This information is very useful when running the fixboot and fixmbr commands.
The MAP command is only available when using the fault recovery console.
MAP [ARC]
parameter
ARC
Indicates the MAP command to display the Advanced RISC Calculation (ARC) device name instead of the device name. The following is an example of the name of the ARC device:
Multi (0) Disk (0) rdisk (0) Partition (1)
The equivalent device name is:
/ Device / HardDisk0 / Partition1
example
The following example maps the physical device name to the drive letter named using the ARC device:
Map Arc
note
· If you do not use the ARC parameter, the MAP command displays the device name.
· The map command also displays the type of file system and the size of each disk (MB).
CLS
Clear the screen.
The cleared screen only displays the command prompt and insert point.
Disable
Disable Windows XP, Windows 2000, or Windows NT 4.0 system service or device driver. The disable command is only available when using the fault recovery console. Disable {service_name} [device_driver_name}
parameter
Service_name
System service name to be disabled.
Device_Driver_name
The device driver name to be disabled.
example
The following example will disable the EventLog service:
Disable EventLog
note
• The disable command sets the specified service or the startup type of the driver to Service_Disabled.
· When using the disable command to disable the system service or device driver, the name of the system service or device driver last start type will be displayed on the screen. This name should be recorded in order to use the enable command to use the Enable command to restore the startup type to last settings.
· There are five types of start-up types. The first three types are: service_auto_start, service_disabled, and service_demand_start. Corresponding standard launch type: Auto, disabled, and manual, usually configured using "Services" in the Computer Management management tool. The latter two types are: service_boot_start and service_system_start, usually used to configure the way to load the device driver. For example, load it when you start your computer or when Windows is started.
Enable
Enable Windows XP, Windows 2000, or Windows NT 4.0 system service or device drivers. The enable command is only available when using the fault recovery console.
Enable {service_name | device_driver_name} [startup_type]
parameter
Service_name
To enable the name of the system service.
Device_Driver_name
The name of the device driver to be enabled.
STARTUP_TYPE
The start-up types are assigned to the service or device driver. Effective start types include:
Service_boot_start
· Service_system_start
Service_Auto_Start
Service_Demand_Start
example
The next example sets the start-up type of the EventLog service to Auto or Service_Auto_Start:
ENABLE EVENTLOG Service_AUTO_START
note
• If the start type is not assigned, the enable command lists the current start-up type of the service or device driver specified in Service_name.
· When you use the enable command to change the startup type, the name of the last start type will appear on the screen. This name should be kept to restore the start type to last settings when needed.
Exit
Turn off the fault recovery console and restart your computer. The exit command is only available when using the "Fault Recovery Console".
Exit
Parameter
Help
Provide online information about the fault recovery console command.
Help [CommandName]
Parameter
List the commands provided in the fault recovery console.
CommandName
Provide command information, including parameters used by commands.
note
· There are two ways to get the online help of the command. You can specify the command name after the HELP command, or you can type the command name and /?. switch. For example, type the following command to get information about the extract command:
Help Extract
EXTRACT /?
Listsvc
List the services and drivers that can be used on your computer. The listsvc command is only available when using the fault recovery console.
Listsvc
Parameter
Logon
Log in to Windows installation. The logon command is only available when using the fault recovery console.
Logon
Parameter
note
• The Logon command lists all detected Windows installations, and the local administrator password that needs to be installed can be installed. · If the 3 times a login attempt fails, the "Fault Recovery Console" will exit and the computer will restart.
Net USE
Connect the network to the drive letter. NET USE commands with the following parameters are only available when using the fault recovery console. The NET USE command with different parameters can be used at the command prompt.
grammar
Net use [/ / computername / sharename [/ user: [domainname /] username] password] | [Drive
Letter:] [/ d]
parameter
/ / servername / sharename
Specifies the name of the server and shared resources. If ComputerName contains blank characters, the computer name is enclosed from the double reverse slash (/ /) to the computer name. The computer name length can be 1 to 15 characters.
/ User
Specifies the username to establish a connection.
domain name
The domain name to be used when confirming the user's credentials. username
Specifies the username used when logging in.
password
Specifies the password required to access the shared resource. Do not enter your password, give a prompt to type a password. The password is not displayed when you type a password at the password prompt.
/ d
Indicates that the connection will be continuously opened.
Set
Display and set the environment variable of the "Fault Recovery Console". The SET command is an optional command that must be used with the security template.
SET commands containing different parameters are only available when using fault failures. The set command with different parameters can be used at the command prompt.
Set [variable = [string]]]
parameter
Variable
Specifies the variables that need to be set or modified.
"Fault Recovery Console" supports the following environment variables:
Variable description
AllowWildCards allows some commands (such as DEL commands to support wildcard.
AllowAllPaths allows all files and directories on the system.
AllowRemovableMedia allows files to be copied to removable media, such as floppy disks.
NocopyPROMPT is not displayed when the existing file is overwritten.
String
Specifies the string to be associated with the specified variable.
example
The next example allows the use of wildcards in some fault recovery console commands:
Set allowWildcards = true
Specifies the location and name of the directory to be deleted. Can't use wildcard.
note
· The directory must fail for the empty command.
• RMDIR applies only to the current Windows installed system directory, mobile media, hard disk partitions root, or local installation source.
Systemroot
Set the current directory to the SystemRoot folder of the Windows installation system logged in to the user. The systemRoot command is only available when using the fault recovery console.
Systemroot
Parameter