Attrib

Changes file attributes for a single file or directory. This command sets or removes the read-only, system, hidden, and compressed attributes assigned to files or directories.

The attrib command with the parameters listed below is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program. The attrib command with different parameters is available from the command prompt in Windows 2000.

attrib [+r|-r] [+s|-s] [+h|-h] [+c|-c] [[drive:][path] filename]

Parameters

+r

Sets the read-only file attribute.

-r

Clears the read-only 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.

+c

Sets the compressed file attribute.

-c

Clears the compressed file attribute.

[[drive:][path] filename]

Specifies the location and name of the directory or file you want to process. You can change attributes for only one file or directory at a time.

Note

  • You can change multiple attributes for a particular file or directory with a single command.

Related Topics


Batch

Executes the commands specified in a text file. The batch command is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program.

batch input_file [output_file]

Parameters

input_file

Specifies the text file that contains the list of commands to be executed. Input_file can consist of a drive letter and a colon, a directory name, a file name, or a combination.

output_file

If specified, stores the output of the commands in the named file. If not specified, the output is displayed on the screen.

Example

The following example executes the batch file C:\Jobs\Find.txt and stores the output in the file C:\Jobs\Results.txt:

batch c:\jobs\find.txt c:\jobs\results.txt


Chdir (Cd)

Displays the name of the current directory or changes the current folder.

The chdir or cd command with the parameters listed below is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program. The chdir command with different parameters is available from the command prompt in Windows 2000.

chdir [drive:][path] [..]

-or-

cd [drive:][path] [..]

Parameters

none

Used without parameters, chdir displays the names of the current drive and folder. Used with only a drive letter (for example, cd C:), chdir displays the current directory on the specified drive.

[drive:][path]

Specifies the drive (if other than the current drive) and directory to which you want to change.

[..]

Specifies that you want to change to the parent folder. Use a space between chdir and the two periods.

Notes

  • Chdir treats spaces as delimiters. Use quotation marks around a directory name containing spaces. For example:

    cd "driver cache"

  • Chdir only operates within the system directories of the current Windows installation, removable media, the root directory of any hard disk partition, or the local installation sources.


Chkdsk

Creates and displays a status report for the disk. Chkdsk also lists and corrects errors on the disk.

The chkdsk command with the parameters listed below is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program. The chkdsk command with different parameters is available from the command prompt in Windows 2000.

chkdsk [drive:] [/p] [/r]

Parameters

none

Used without parameters, chkdsk displays the status of the disk in the current drive.

drive:

Specifies the drive that you want chkdsk to check.

/p

Performs an exhaustive check even if the drive is not marked for chkdsk to run. This parameter does not make any changes to the drive.

/r

Locates bad sectors and recovers readable information. Implies /p.

Note

  • Chkdsk requires the file Autochk.exe. If it cannot find it in the startup directory (\Winnt\System32, by default), it will attempt to locate it on the Windows 2000 Installation CD. If you have a multi-boot computer, be sure you are issuing this command from the drive containing Windows 2000.


Cls

Clears the screen.

The cleared screen shows only the command prompt and insertion point.

cls

Parameters

none


Copy

Copies a single file to another location. The copy command with the parameters listed below is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program. The copy command with different parameters is available from the command prompt in Windows 2000.

copy source [destination]

Parameters

source

Specifies the location and name of the file to be copied. Source can consist of a drive letter and colon, a directory name, a file name, or a combination.

destination

Specifies the location and name of a file or set of files to which you want to copy. Destination can consist of a drive letter and colon, a folder name, a file name, or a combination.

Notes

  • The source may be removable media, any directory within the system directories of the current Windows installation, the root of any drive, the local installation sources, or the Cmdcons directory.
  • The destination may be any of the same locations as the source except removable media. If a destination is not specified, it defaults to the current directory.
  • A compressed file from the Windows Installation CD is decompressed as it is copied.
  • Copy does not support wildcard characters.


Delete (Del)

Deletes a single file. The delete or del command with the parameters listed below is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program. The delete or del command with different parameters is available from the command prompt in Windows 2000.

delete [drive:][path] filename

-or-

del [drive:][path] filename

Parameters

[drive:][path] filename

Specifies the location and name of the file you want to delete.

Note

  • Delete only operates within the system directories of the current Windows installation, removable media, the root directory of any hard disk partition, or the local installation sources.


Dir

Displays a list of the files and subdirectories in a directory. The dir command with the parameters listed below is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program. The dir command with different parameters is available from the command prompt in Windows 2000.

dir [drive:][path][filename]

Parameters

[drive:][path]

Specifies the drive and directory for which you want to see a listing.

[filename]

Specifies a particular file or group of files for which you want to see a listing. Multiple file names can be used. File names can be separated by spaces, commas, or semicolons. You can use wildcard characters (? and *) in the filename parameter to display a group of files.

Dir also lists the disk's volume label and serial number, and the total number of files listed, their cumulative size, and the free space (in bytes) remaining on the disk. For each file and subdirectory, dir lists the file name extension, the file size in bytes, the date and time the file was last modified, and the following file attributes, if applicable:

Abbreviation | Attribute
d | Directory
h | Hidden file
s | System file
e | Encrypted
r | Read-only
a | File ready for archiving
c | Compressed
p | Reparse point

Note

  • Dir only operates within the system directories of the current Windows installation, removable media, the root directory of any hard disk partition, and the local installation sources.


Disable

Disables a Windows 2000 or Windows NT 4.0 system service or a device driver. The disable command is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program.

disable {service_name] | [device_driver_name}

Parameters

service_name

The name of the system service you want to disable.

device_driver_name

The name of the device driver you want to disable.

Example

The following example disables the Eventlog service:

disable eventlog

Notes

  • The disable command sets the startup type to SERVICE_DISABLED for the service or driver you specify.
  • When you use the disable command to disable a system service or a device driver, the name of the previous startup type for the system service or device driver will display on the screen. You should write this name down in case you need to restore the startup type to its previous setting using the enable command.
  • There are five startup types. The first three, SERVICE_AUTO_START, SERVICE_DISABLED, and SERVICE_DEMAND_START, correspond to the standard startup types, Automatic, Disabled, and Manual, which you typically configure using Services in the Computer Management administrative tool. The last two, SERVICE_BOOT_START and SERVICE_SYSTEM_START, are commonly used to configure the way device drivers load; for example, when the computer is started or when Windows 2000 starts.


Diskpart

Creates and deletes partitions on a hard drive. The diskpart command is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program.

diskpart [/add | /delete] [device_name | drive_name | partition_name] [size]

Parameters

none

Used without parameters, the diskpart command starts the Windows 2000 character-mode version of diskpart

/add

Creates a new partition.

/delete

Deletes an existing partition.

device_name

The device on which you want to create or delete a partition. The name can be obtained from the output of the map command. An example of a device name is:

\Device\HardDisk0

drive_name

The partition you want to delete, by drive letter. Used only with /delete. An example of a drive name is:

D:

partition_name

The partition you want to delete, by partition name. Can be used in place of the drive_name. Used only with /delete. An example of a partition name is:

\Device\HardDisk0\Partition1

size

The size, in megabytes (MB), of the partition you want to create. Used only with /add.

Examples

The following examples delete a partition:

diskpart /delete \Device\HardDisk0\Partition3

diskpart /delete F:

The following example adds a 20 MB partition to your hard drive:

diskpart /add \Device\HardDisk0 20


Enable

Enables a Windows 2000 or Windows NT 4.0 system service or a device driver. The enable command is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program.

enable {service_name | device_driver_name} [startup_type]

Parameters

service_name

The name of the system service you want to enable.

device_driver_name

The name of the device driver you want to enable.

startup_type

The startup type that you want to designate for the service or device driver.

Example

The following example sets the startup type for the Eventlog service to Automatic or SERVICE_AUTO_START:

enable eventlog service_auto_start

Notes

  • If you do not designate a startup type, the enable command lists the current startup type for the service or device driver you specified in service_name.
  • There are five startup types. The first three, SERVICE_AUTO_START, SERVICE_DISABLED, and SERVICE_DEMAND_START, correspond to the standard startup types, Automatic, Disabled, and Manual, which you typically configure using Services in the Computer Management administrative tool. The last two, SERVICE_BOOT_START and SERVICE_SYSTEM_START, are commonly used to configure the way device drivers load; for example, when the computer is started or when Windows 2000 starts.
  • When you use the enable command to change a startup type, the previous startup type's name will display on the screen. You should write this name down in case you need to restore the startup type to the previous setting.


Exit

Closes the Windows 2000 Recovery Console and restarts your computer. The exit command is available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program.

exit

Parameters

none


Expand

Extracts a file from a compressed file. Use this command to extract a driver file from a cabinet (.cab) or compressed file on the Windows 2000 CD.

The expand command with the parameters listed below is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program. The expand command with different parameters is available from the command prompt in Windows 2000.

expand [/d] [/y] source | source.cab [/F:filespec}] [destination]

Parameters

/d

Lists the files contained in the cabinet file without expanding it or extracting from it.

/y

Suppresses the overwrite prompt when expanding or extracting files.

source

Specifies the file to expand. Use this if the source file contains a single file. Source can consist of a drive letter and a colon, a directory name, a file name, or a combination. You cannot use wildcard characters.

source.cab /f:filespec

Specifies a cabinet file to extract from, and the name of the file or files you want to extract. Use this if the source file contains multiple files. You can use wildcards for the files you want to extract.

destination

Specifies the destination directory and/or file name for the extracted file.

Examples

The following example extracts the file Msgame.sys from the Drivers cabinet file on the Windows 2000 CD and copies it to C:\Winnt\System\Drivers:

expand d:\i386\driver.cab \f:msgame.sys c:\winnt\system\drivers

The following example expands the compressed file Access.cp_:

expand d:\i386\acces.cp_ c:\winnt\system32\access.cpl

The following example lists all the files in the Drivers cabinet file on the Windows 2000 CD:

expand /d d:\i386\driver.cab

Important

  • The Driver cabinet file, which contains most of the drivers provided by Windows 2000, includes thousands of files. Expanding all of the files from this cabinet file onto your hard disk will take time and a lot of disk space. It is recommended that you extract only the file you need from this file.

Notes

  • If the destination is not specified, the file is copied to the current directory.
  • You cannot specify a floppy disk drive or a CD-ROM as the destination.


Fixboot

Writes a new partition boot sector to the system partition. The fixboot command is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program.

fixboot [drive]

Parameter

drive

The drive to which a boot sector will be written. This replaces the default drive, which is the system partition you are logged on to. An example of a drive is:

D:

Example

The following example writes a new partition boot sector to the system partition in drive D:

fixboot d:

Note

  • Using the fixboot command without any parameters will write a new partition boot sector to the system partition you are logged on to.


Fixmbr

Writes a new master boot record to a hard drive. The fixmbr command is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program.

fixmbr [device_name]

Parameter

device_name

The device (drive) on which you want to write a new master boot record. The name can be obtained from the output of the map command. An example of a device name is:

\Device\HardDisk0.

Example

The following example writes a new master boot record to the device specified:

fixmbr \Device\HardDisk0

Notes

  • If you do not specify a device_name, a new master boot record will be written to the boot device, which is the drive on which your primary system is loaded.
  • If an invalid or nonstandard partition table signature is detected, you will be prompted whether you want to continue. If you are not having problems accessing your drives, you should not continue. Writing a new master boot record to your system partition could damage your partition tables and cause your partitions to become inaccessible.


Format

Formats the specified drive to the specified file system for use with Windows 2000. The format command with the parameters listed below is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program. The format command with different parameters is available from the command prompt in Windows 2000.

format [drive:] [/q] [/fs:file-system]

Parameters

drive:

Specifies the drive you want to format. You cannot format a floppy disk from the Recovery Console.

/q

Performs a quick format of the drive. The drive is not scanned for bad areas, so you should use this parameter only on drives that you have previously formatted.

/fs:file-system

Specifies the file system to use: FAT, FAT32, or NTFS. If you don't specify a file system, the existing file system format is used.


Help

Provides online information about the Windows 2000 Recovery Console commands.

help [commandname]

Parameter

none

Lists the commands that are available in the Recovery Console.

commandname

Provides information about the command, including the parameters you can use with the command.

Note

  • There are two ways to get online Help for a command. You can specify the name of the command after the help command, or you can type the name of the command and the /? switch at the command prompt. For example, you can type either of the following commands to get information about the extract command:

    help extract
    extract /?


Listsvc

Lists the services and drivers available on the computer. The listsvc command is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program.

listsvc

Parameters

none


Logon

Logs you on to an installation of Windows 2000 or Windows NT 4.0. The logon command is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program.

logon

Parameters

none

Note

  • The logon command will list all detected installations of Windows 2000 and Windows NT, and request the local administrator password for that installation to log you on.


Map

Displays a mapping of drive letters to physical device names. This information is useful when you run the fixboot, fixmbr, or fdisk commands. The map command is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program.

Map [arc]

Parameter

arc

Instructs the map command to display Advanced RISC Computing (ARC) device names instead of Windows 2000 device names. An example of an ARC device name is:

multi(0)disk(0)rdisk(0)partition(1)

The equivalent Windows 2000 device name is:

\Device\HardDisk0\Partition1

Example

The following example maps the physical device names to the drive letters using ARC device names:

map arc

Notes

  • If you do not use the arc parameter, the map command displays Windows 2000 device names.
  • The map command also displays the type of file system and the size of each disk in megabytes (MB).


Mkdir (Md)

Creates a directory or subdirectory. The mkdir command with the parameters listed below is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program. The mkdir command with different parameters is available from the command prompt in Windows 2000.

mkdir [drive:]path

-or-

md [drive:]path

Parameters

drive:

Specifies the drive on which you want to create the new directory.

path

Specifies the name and location of the new directory. You cannot use wildcard characters.

Note

  • Mkdir only operates within the system directories of the current Windows installation, removable media, the root directory of any hard disk partition, or the local installation sources.


More

Displays the contents of a text file. Use the more or type command to view a text file without modifying it. The more command with the parameters listed below is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program. The more command with different parameters is available from the command prompt in Windows 2000.

more [drive:][path] filename

-or-

type [drive:][path] filename

Parameter

[drive:][path] filename

Specifies the location and name of the file that you want to view.

If you are using an NTFS drive, and the file name contains spaces, you must enclose the file name within quotation marks (").


Rename (Ren)

Changes the name of a single file. The rename command with the parameters listed below is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program. The rename command with different parameters is available from the command prompt in Windows 2000.

rename [drive:][path] filename1 filename2

-or-

ren [drive:][path] filename1 filename2

Parameters

[drive:][path] filename1

Specifies the location and name of the file you want to rename. You cannot use wildcard characters.

filename2

Specifies the new name for the file. You cannot specify a new drive or path when renaming files.


Rmdir (Rd)

Removes (deletes) a directory. The rmdir command with the parameters listed below is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program. The rmdir command with different parameters is available from the command prompt in Windows 2000.

rmdir [drive:]path

-or-

rd [drive:]path

Parameters

[drive:]path

Specifies the location and name of the directory you want to delete. You cannot use wildcard characters.

Notes

  • The directory must be empty or the command will fail.
  • Rmdir only operates within the system directories of the current Windows installation, removable media, the root directory of any hard disk partition, or the local installation sources.


Set

Displays and sets Recovery Console environment variables. The set command is an optional command that must be enabled with Security Templates.

The set command with the parameters listed below is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program. The set command with different parameters is available from the command prompt in Windows 2000.

set [variable=[string]]

Parameters

none

Used without parameters, set displays the current environment settings.

variable

Specifies the variable you want to set or modify.

The Recovery Console supports the following environment variables:

Variable | Description
AllowWildCards | Enables wildcard support for some commands (such as the del command).
AllowAllPaths | Allows all files and directories on the system to be accessed.
AllowRemovableMedia | Allows files to be copied to removable media, such as a floppy disk.
NoCopyPrompt | Does not display a prompt when overwriting an existing file.

string

Specifies the string you want to associate with the specified variable.

Examples

The following example enables you to use wildcards with some Recovery Console commands:

set allowwildcards=true

The following example turns off the prompt when you are overwriting files:

set nocopyprompt=true

Notes

  • The set command is disabled by default. To enable the set command, use the Security templates. The Enables the Set command for the Recovery Console attribute is located in the console tree under Local Computer Policy/Computer Configuration/Windows Settings/Security Settings/Local Policies/Security Options.
  • All environmental variables are set to FALSE by default.


Systemroot

Sets the current directory to the systemroot folder of the Windows 2000 installation you are logged on to. The systemroot command is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program.

systemroot

Parameters

none


Type

Displays the contents of a text file. Use the type or more command to view a text file without modifying it. The type command with the parameters listed below is only available when you are using the Windows 2000 Recovery Console, which can be started from the Windows 2000 Setup program. The type command with different parameters is available from the command prompt in Windows 2000.

type [drive:][path] filename

-or-

more [drive:][path] filename

Parameter

[drive:][path] filename

Specifies the location and name of the file that you want to view.

If you are using an NTFS drive, and the file name contains spaces, you must enclose the file name within quotation marks.