Home > Commands N-Z > Commands R

RESTORE


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Restores files that were backed up by using any version of BACKUP from v2.0 through v5.0. If you are restoring files that were backed up using the MSBACKUP program in v6.0 or later, use that version of the MSBACKUP program to restore those files.

You can restore files from similar or dissimilar disk types.


Syntax

RESTORE drive1: drive2:[path[filename]] [/S] [/P] [[/B:date] | [/A:date] | [/N]] [/E:time] [/L:time] [/M] [/D] [/Y] [/Z]


Parameters
drive1: (v2.0 Win95 NT3.5)
Specifies the drive on which the backed-up files are stored.
drive2: (v2.0 Win95 NT3.5)
Specifies the drive to which the backed-up files will be restored.
filename (v2.0 Win95 NT3.5)
Specifies the names of the backed-up files you want to restore.
path (v2.0 Win95 NT3.5)
Specifies the directory to which the backed-up files will be restored. You must specify the same directory from which the files were backed up.

Switches
/A:date (v3.30 Win95 NT3.5)
Restores only those files last modified on or after the specified date. The format of date varies according to the COUNTRY setting in your CONFIG.SYS file. For information about specifying date, see the DATE command.
/B:date (v3.30 Win95 NT3.5)
Restores only those files last modified on or before the specified date. The format of date varies according to the COUNTRY setting in your CONFIG.SYS file. For information about specifying date, see the DATE command.
/D (v5.0 Win95 NT3.5)
Displays a list of the files on the backup disk that match the names specified in filename without restoring any files. Even though no files are being restored, you must specify drive2 when you use /D.
/E:time (v3.30 Win95 NT3.5)
Restores only those files last modified at or earlier than the specified time. The format of time varies according to the COUNTRY setting in your CONFIG.SYS file. For information about specifying time, see the TIME command.
/L:time (v3.30 Win95 NT3.5)
Restores only those files last modified at or later than the specified time. The format of time varies according to the COUNTRY setting in your CONFIG.SYS file. For information about specifying time, see the TIME command.
/M (v3.30 Win95 NT3.5)
Restores only those files modified since the last backup.
/N (v3.30 Win95 NT3.5)
Restores only those files that no longer exist on the destination disk.
/P (v5.0 Win95 NT3.5)
Prompts you for permission to restore files that are read-only (that have the read-only attribute set) or that have changed since the last backup (that have the archive attribute set).
/S (v5.0 Win95 NT3.5)
Restores all subdirectories.
/Y v2.0?
UNDOCUMENTED unknown.
/Z v2.0?
UNDOCUMENTED unknown.

Related

For information about backing up files, see the MSBACKUP command.


Notes
Checking restored files

Once a file has been restored, you can use the DIR or TYPE command to make sure the file was restored properly.


Limitations on RESTORE

You cannot use the RESTORE command to restore system files (IO.SYS and MSDOS.SYS). RESTORE does not work with drives that have been redirected with the ASSIGN or JOIN command.


Compatibility with previous Versions of BACKUP

The v6.22 RESTORE command can restore files that were backed up by using the BACKUP command in v2.0 through v5.0.


Listing the names of backed-up files

Use the /D switch to see a list of the backed up files. If you specify filename with the /D switch, RESTORE displays a list of the backed up files that match the name you specify. If you use the /D switch, RESTORE does not restore any files.


Restoring to different drives

While you must restore files to their original directory, you can restore them to a different drive. For example, files backed up from the C:\MYFILES\*.* directory can be restored to the D:\MYFILES\*.* directory.


Examples

To restore the file INVEST.MNT from the backup disk in drive A to the IRS directory on drive C, type:

    RESTORE A: C:\IRS\INVEST.MNT

The operating system prompts you to insert the backup disk into drive A. Once the backup disk is in drive A, press ENTER to continue.


Suppose you backed up all of the files in the directory \USER\ADAMS on drive C. To restore these files, insert the backup disk in drive A and type:

    RESTORE A: C:\USER\ADAMS\*.*

It is important that you specify *.* for filename. Otherwise, the RESTORE command attempts to restore a file named ADAMS in the USER directory.


To restore a complete hard disk from a backup disk (or disks) in drive A, type:

    RESTORE A: C:\*.* /S

The /S switch and the wildcards (*.*) specify that RESTORE is to restore all backed-up files to their original directories and subdirectories on drive C.


Errorlevels

You can use the ERRORLEVEL parameter on the IF command-line in a batch program to process exit codes returned by RESTORE.

For an example of a batch program that processes exit codes, see the IF command or the CHOICE command.


Availability
External
DOS
v2.0 v2.01 v2.05 v2.10 v2.11 v2.11R v2.12 v2.2 v2.25 v3.0 v3.20 v3.05 v3.1 v3.21 v3.25 v3.30 v3.3A v3.3R v3.3T v3.31 v3.40 v4.0 v4.01 v4.01A v5.0 v5.0A v5.00.02 v5.001A v5.01 v5.02 v6.0 v6.10 v6.2 v6.21 v6.22 v6.23 v7.00 v7.0R1 v7.10
Windows
Win95 Win98
Windows NT
NT3.5 NT4