Microsoft KB Archive/86646

= How to Restore Backed-up Files to a Different Directory =

Article ID: 86646

Article Last Modified on 5/10/2003

-

APPLIES TO


 * Microsoft MS-DOS 3.3 Standard Edition
 * Microsoft MS-DOS 4.0 Standard Edition
 * Microsoft MS-DOS 4.01 Standard Edition
 * Microsoft MS-DOS 5.0 Standard Edition
 * Microsoft MS-DOS 5.0a
 * Microsoft MS-DOS 6.0 Standard Edition
 * Microsoft MS-DOS 6.2 Standard Edition
 * Microsoft MS-DOS 6.21 Standard Edition
 * Microsoft MS-DOS 6.22 Standard Edition

-



This article was previously published under Q86646



SUMMARY
The MS-DOS RESTORE command will only place backed-up files into the directory where they were backed up from. If you do not want to restore the files you backed up with the MS-DOS BACKUP utility to the same directory, you can either:


 * RESTORE to a different drive. -or-


 * Fool RESTORE using the SUBST command.

NOTE: This information applies to MS-DOS Restore (RESTORE.EXE). It does not apply to Microsoft Backup for MS-DOS (MSBACKUP.EXE) or Microsoft Backup for Windows (MWBACKUP.EXE).



Example
If you want to restore the files backed up from the C:\DATA directory but don't want to mix them with the files currently in the C:\DATA directory, and you have another hard drive on your system, you can restore to drive D with the following command:   restore a: d:\data\*.* RESTORE would place all files backed up from the \DATA directory into the D:\DATA directory.

However, if you do not have another hard drive, you can use the following commands:   md c:\old subst d: c:\old restore a: d:\data\*.* RESTORE will place all files backed up from the \DATA directory into the D:\DATA directory, which is actually the C:\OLD\DATA directory.

Explanation
The MS-DOS BACKUP utility stores the full path of each file that is backed up (for example, \DATA\INFO.DAT). This allows RESTORE to recreate your entire subdirectory structure, if necessary.

When you specify &quot;RESTORE A: D:\DATA\*.*&quot;, RESTORE searches for the files backed up from the \DATA directory, and copies them to the \DATA directory on drive D. Because the drive letter is not saved by BACKUP, RESTORE is able to place the file in a \DATA directory on any MS-DOS logical drive (but only in a the \DATA directory).

SUBST allows you (and many utilities, including RESTORE) to substitute a drive designator (such as D) for a directory path (such as C:\OLD).