Microsoft KB Archive/79851

= Microsoft Knowledge Base =

PD0315: MS-DOS Backup/Restore Supplemental Utilities
Last reviewed: May 1, 1997

Article ID: Q79851

3.x 4.x 5.00 MS-DOS kbfile kbappnote

The information in this article applies to:


 * Microsoft MS-DOS operating system versions 3.x, 4.x, 5.0

The Application Note titled &quot;MS-DOS Backup/Restore Supplemental Utilities&quot; (PD0315) includes a set of utility programs designed to assist in the use of the MS-DOS BACKUP and RESTORE commands.

There are four utility programs included with PD0315:

V32slash - A utility to convert the MS-DOS 3.20 backup disks to a format compatible with IBM PC-DOS 3.20 backup files.

Srest   - A utility that restores files from MS-DOS 3.21 or earlier backup disks that will not restore properly using the RESTORE command.

Backinfo - A utility that allows you to view the contents of MS-DOS 3.30 or later backup disks.

Nrest   - A utility that attempts to restore files from MS-DOS 3.30 or later backup disks that will not restore properly using the RESTORE command. You can obtain this Application Note from the following sources:

You can obtain this Application Note from the following sources:


 * Microsoft's World Wide Web Site on the Internet
 * The Internet (Microsoft anonymous ftp server)
 * Microsoft Download Service (MSDL)
 * Microsoft Product Support Services

For complete information, see the &quot;To Obtain This Application Note&quot; section at the end of this article.

THE TEXT OF PD0315
Microsoft Product Support Services Application Note (Text File) PD0315: MS-DOS BACKUP/RESTORE SUPPLEMENTAL UTILITIES Revision Date: 9/91 Disk Included The following information applies to Microsoft MS-DOS versions 3.x, 4.0x, and 5.0.

| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY   |
 * ACCOMPANY THIS DOCUMENT (collectively referred to as an           |
 * Application Note) IS PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY     |
 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO   |
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A    |
 * PARTICULAR PURPOSE. The user assumes the entire risk as to the    |
 * accuracy and the use of this Application Note. This Application   |
 * Note may be copied and distributed subject to the following       |
 * conditions: 1) All text must be copied without modification and   |
 * all pages must be included; 2) If software is included, all files |
 * on the disk(s) must be copied without modification [the MS-DOS(R) |
 * utility DISKCOPY is appropriate for this purpose]; 3) All         |
 * components of this Application Note must be distributed together; |
 * and 4) This Application Note may not be distributed for profit.   |
 * Copyright 1991 Microsoft Corporation. All Rights Reserved.        |
 * Microsoft, MS-DOS, and the Microsoft logo are registered          |
 * trademarks and Windows is a trademark of Microsoft Corporation.   |
 * trademarks and Windows is a trademark of Microsoft Corporation.   |

INTRODUCTION ============ The MS-DOS Backup/Restore Supplemental Utilities disk provided with this application note contains utilities designed to assist in the use of the MS-DOS BACKUP and RESTORE commands. This document describes the purpose and usage of each utility contained on the disk and provides additional information on the use of the BACKUP and RESTORE commands.

The MS-DOS Backup/Restore Supplemental Utilities disk contains four subdirectories:

Subdirectory    Contents

BACKCONV.V32    V32SLASH.EXE, a utility to convert the MS-DOS 3.2 backup disks to a format compatible with the IBM PC-DOS 3.2 backup files. This utility is explained below and also in the document V32SLASH.TXT that is included in this subdirectory.

RESTORE.V32     SREST.EXE, a utility that restores files from MS- DOS 3.21 or earlier backup disks that will not restore properly using the RESTORE command. This utility is explained below and also in the document SREST.TXT that is included in this subdirectory.

VIEWER.V33      BACKINFO.EXE, a utility that allows you to view the contents of an MS-DOS 3.3 or later backup disk. This utility is explained below and also in                   the document BACKINFO.TXT that is included in this subdirectory.

RESTORE.V33     NREST.EXE, a utility that attempts to restore files from MS-DOS 3.3 or later backup disks that will not restore properly using the RESTORE command. This utility is explained below and also in the document NREST.TXT that is included in this subdirectory. To change to one of these subdirectories, insert the MS-DOS Backup/Restore Supplemental Utilities disk in floppy-disk drive A, type the following command at the A> command prompt, and press ENTER

cd a:\ where is the name of the directory you want to change to.

For example, to change to the VIEWER.V33 directory, type the following command at the A> command prompt, and press ENTER:

cd a:\viewer.v33

THE MS-DOS BACKUP/RESTORE COMMANDS
Backup disks created with the MS-DOS BACKUP utility have one of two backup file formats. The format depends upon the version of MS-DOS that was used to create the backup. Backup disks created with MS-DOS version 3.21 or earlier have a directory similar to:

Volume in drive A has no label Directory of A:\

BACKUPID @@@     128   4-05-91   3:21p COMMAND COM    23740   5-01-87  12:00a CONFIG  SYS      414   4-05-88   8:49a AUTOEXEC BAT     635   4-05-88   8:49a 4 File(s)   331776 bytes free There is one BACKUPID.@@@ file and one or more files with names identical to the files backed up to the disk.

NOTE: While the files on the backup disk appear to be identical to the files backed up, these files are not identical. The BACKUP utility adds a 128-byte header to each of these files. Backup disks created using MS-DOS versions 3.3, 3.31, 4.0, 4.01, and 5.0 have a directory similar to:

Volume in drive A is BACKUP 001 Volume Serial Number is 0D0D-11F6 Directory of A:\

BACKUP  001    261577 04-05-91   5:00p CONTROL 001       651 04-05-91   5:00p 2 file(s) 262228 bytes 98328 bytes free There is one BACKUP.001 and one CONTROL.001 file. The BACKUP.001 file contains the information from the backed-up files. The CONTROL.001 file is used by the BACKUP/RESTORE commands to track the information contained within the BACKUP.001 file. The number 001 indicates the backup disk is the first disk in a series of backup disks. If there are additional disks, the second backup disk in the series would contain BACKUP.002 and CONTROL.002, the third disk in the series would contain BACKUP.003 and CONTROL.003, and so forth.

NOTE: Because there are many original equipment manufacturers (OEMs) who are licensed to distribute MS-DOS and because these OEMs may make modifications to MS-DOS, the backup file format used in your OEM's MS-DOS may vary. Contact your OEM if you have questions regarding the backup format used in your version of MS-DOS.

IMPORTANT NOTES ON USING THE MS-DOS RESTORE COMMAND
The MS-DOS RESTORE command for a given version of MS-DOS is intended to be used to restore files backed up under the same version of MS-DOS or a version of MS-DOS with a similar backup file format. For example, the MS-DOS 3.2 RESTORE command can restore backups from version 3.21 or earlier. However, it cannot restore files backed up under MS-DOS versions 3.3, 3.31, 4.0, 4.01, or 5.0. Likewise, the MS-DOS 3.3, 3.31, 4.0, and 4.01 RESTORE command cannot restore backups created with MS- DOS version 3.21 or earlier. However, the MS-DOS 5.0 RESTORE command can be used to restore backups created with the BACKUP command from all versions of MS-DOS through 5.0.

The MS-DOS RESTORE command restores backup files only to the same path and filename that the files were originally backed up from. However, you can specify a different drive letter. For example, a file named FILE.TXT that is backed up from the C:\TEST subdirectory can be restored to the TEST subdirectory, with a filename of FILE.TXT, on any valid drive. It cannot be restored to any other directory or be given a different filename.

When using the RESTORE command, you must either specify the name of the file that you want to restore or use the wildcard (*) file specification. For example, the FILE.TXT file backed up from the C:\TEST directory could be restored from the backup disk in floppy drive A using either of the following commands:

restore a: c:\test\file.txt

restore a: c:\test\*.* These are just two examples of valid RESTORE commands to use for this file. (Please note that the second command will restore all files that were backed up from the C:\TEST subdirectory, whereas the first command will restore only the FILE.TXT file.)

The following command will restore all files from a set of backup disks to the same path and filename that the files were backed up from

restore : :\*.* /s where  is the floppy drive containing the backup disks and  is the drive you want to restore the backups to. For example, to restore all the files from the backup disk(s) in drive A to drive C with the same path and filename they were originally backed up from, use the following command:

restore a: c:\*.* /s This command automatically creates the appropriate subdirectories on the destination drive. Note that any files currently on the destination drive that have the same path and filename as any of the backed-up files are automatically overwritten. The /s switch tells the RESTORE command to include the files that were backed up from subdirectories.

THE BACKUP/RESTORE SUPPLEMENTAL UTILITIES
V32SLASH Version 1.0 -- An MS-DOS 3.2 Backup-Floppy-Disk Conversion Utility

The V32SLASH utility allows you to convert backup files on an MS-DOS version 3.2 floppy disk to a format that is compatible with IBM PC-DOS version 3.2 backup files. Each backed-up file contains a 128-byte header. The path that this file was backed up from is stored within this header. On MS-DOS backup disks, a forward slash (/) is used as the path delimiter. On IBM PC-DOS backup disks, a backslash (\) is used as the path delimiter. The MS-DOS version 3.2 RESTORE command accepts either a forward slash or a backslash in the file headers, but IBM PC-DOS version 3.2 supports only the backslash delimiter. The V32SLASH utility changes the forward slash to a backslash on MS-DOS backup disks. As a result, your 3.2 backup files will be compatible with both the MS-DOS and IBM PC-DOS 3.2 RESTORE utilities.

Syntax                  Explanation --                  ---

v32slash : [/v]  is the drive with the backup disk. This is a required parameter. can be any value from a through z.

The /v switch sets the utility in viewing mode, rather than conversion mode. When you use this optional switch, the file will not be converted. The switch merely allows you to see the type of delimiter used.

Examples                Explanation ---

v32slash a:             This command converts the MS-DOS version 3.2 backup files in drive A to a format that is compatible with IBM PC-DOS version 3.2 backup files.

v32slash a: /v          This command shows the file headers of the backup files in drive A but does not attempt to convert the forward slash to a                           backslash. This option is useful both prior to and after running the utility without the /v option. It shows the information that determines if the utility has worked correctly. If the drive you specify is a hard disk, V32SLASH looks for the backup files in the BACKUP directory. If the drive you specify is a removable disk (the usual situation), V32SLASH looks in the root directory of that disk for the backup files. If the /p switch was used with the BACKUP command, BACKUP may have created a BKSUBDIR subdirectory. If V32SLASH finds a BKSUBDIR subdirectory, the files in BKSUBDIR are converted or viewed depending on whether the /v switch was used with the V32SLASH utility.

When all the files on the disk have been converted, you will be asked whether you want to convert another disk. (This occurs only when converting files on a removable disk.) If there are more disks to convert, press Y, insert the next disk, and press any key. When all the disks have been converted, press N (or any key other than Y) and the utility will terminate.

NOTE: Microsoft recommends that you use the V32SLASH utility on   copies of your original backup disks. While there are no known problems with this utility, it would not be wise to risk your original disks in the event problems are discovered later. The MS-DOS DISKCOPY command should be used to create these copies. The following is sample output from V32SLASH:

COMMAND: V32SLASH a:

V32SLASH v1.00, MS-DOS v3.20 BACKUP/RESTORE conformity utility

*** Files were backed up on 07-18-1988 ***

*** Converting files from disk number 01 ***

Now converting : COMMAND.COM Now converting : 4201.CPI Now converting : 5202.CPI Now converting : ANSI.SYS Now converting : APPEND.EXE .         .          .   Now converting : TREE.COM Now converting : BACKUP.COM Now converting : DEBUG.COM

Do you want to convert another disk ?(Y/N) Insert the next backup diskette Strike any key when ready SREST Version 1.0 -- An MS-DOS 3.21

or Earlier Backup-File Restoration Utility
This utility is designed to help you restore files backed up under MS- DOS version 3.21 or earlier. The SREST utility will allow for the restoration of files even if you have disks that are out of sequence or have media errors on the BACKUPID.@@@ file. When the MS-DOS 3.21 or earlier BACKUP command backs up a file, it places a 128-byte header at the beginning of the file. This header contains information such as the path, what section of a divided file this portion is (for files that span more than one disk), as well as other information. SREST strips this header off the backup file.

When a file is split between two disks, each section has the 128-byte header on it. The SREST utility asks you if there is another division of the file on the next disk. If there is, SREST asks you to insert the next disk and press a key. You need to know in advance how many disks contain the file you want to restore. The file sections will always be in order, so just look for the same filename on a group of ordered disks.

Before using the SREST utility, copy the SREST.EXE file from the MS- DOS Backup/Restore Supplemental Utilities disk to a directory on your computer's hard drive that is included in your PATH command. For information on the COPY and PATH commands, please see the MS-DOS user's reference.

Example
Backup Disk 1 Contents  Backup Disk 2 Contents --  --

MISC.DAT                FILE.DAT JUNK.DAT                TRASH.DAT FILE.DAT                WORD.COM

Do the following to restore FILE.DAT (which is split between both backup disks) to your hard drive:

 Place backup disk 1 in drive A.  At the A> command prompt, type the following command, and press ENTER: srest file.dat c:\file.dat  When asked &quot;Is there another division of this file?&quot;, press Y for yes. The SREST utility then displays the message &quot;Insert the next disk and press a key.&quot; Remove backup disk 1 and insert backup disk 2 in drive A, then press any key.

Do the following to restore JUNK.DAT (which is contained on only one backup disk) to your hard drive:

 Place backup disk 1 in drive A.</li>  Type the following at the A> command prompt, and press ENTER: srest junk.dat c:\junk.dat </li> When asked &quot;Is there another division of this file?&quot;, press N for no.</li></ol>

To specify a destination path on your hard drive, type the following

srest junk.dat c:\ \junk.dat where is the name of the directory that you want to restore the file to.

NOTE: The SREST utility is designed to restore only one file at   a time. No wildcards are accepted. BACKINFO Version 1.03 -- An MS-DOS 3.3x,

4.0x, and 5.0 Backup-Disk Viewing Utility
This utility allows you to view the contents of a backup disk created with the MS-DOS version 3.3, 3.31, 4.0, 4.01, or 5.0 BACKUP command.

Syntax           Explanation --           ---

backinfo <drive:> is the disk drive with the backup disk. This is a required parameter. can be any value from a through z.

Example          Explanation ---          ---

backinfo a:      This command displays the contents of the MS-DOS version 3.3 backup files that are on the disk in                     drive A. If the drive you specify is a hard disk, BACKINFO looks for the backup files in the BACKUP subdirectory. If the drive you specify is a removable disk (the usual situation), BACKINFO looks in the root directory of that disk for the backup files.

BACKINFO displays the information about each file in a format that has output similar to the following:

BACKINFO v1.00 -- An MS-DOS v3.30 BACKUP/RESTORE viewing utility *** Displaying files from drive a: *** Disk Number: 01 of 01 ATTR  SIZE  DATE      TIME   SEQ  NAME -a-- 10085  06/13/88  09:39  1/1  \stuff\things\misc\test.hex -a--  8401  06/13/88  11:02  1/1  \apl\src\misc\hello\hello.apl -a--  7124  06/13/88  11:26  1/1  \mod2\src\misc\emulate.mod 416 02/01/88  00:00  1/1  \5202.dcp 52162 02/01/88  00:00  1/1  \viotbl.dcp -a--   485  06/13/88  08:52  1/1  \docs\todo.doc In the header information, the disk sequence number is shown. This disk number contains the current disk number, followed by the number of disks in the backup set. If the disk is not the last disk in the series, then a &quot;?&quot; is displayed for the total number of disks. (This is because the total number of disks in the series is not known until the last disk is finished.) The first column of the output is the ATTR column, which displays the file's attribute as follows:

Attr    Meaning ---

r       Read-only file a       Archived file s       System file h       Hidden file The SIZE column displays the file's size in bytes. The DATE column displays the file's date, and the TIME column displays the file's time. The SEQ column displays the file's sequence number. The first number of the sequence shows which part of the file is contained on this disk, and the second number displays the number of disks on which this file is stored. The second number will be a &quot;?&quot; if the end of the file is not on this disk. Until the end of the file is read, the total number of disks on which this file is stored is not known. This is similar to the disk sequence number. Finally, the NAME column displays the full file specification of the file backed up.

NREST Version 1.0 -- An MS-DOS 3.3x,

4.0x, and 5.0 Backup-File Restoration Utility
This utility allows you to extract files from backup disks created by the MS-DOS 3.3, 3.31, 4.0, 4.01, or 5.0 BACKUP command. The NREST utility attempts to recover files based on information from the backup disk's CONTROL.XXX file. If there is data corruption in the CONTROL.XXX or BACKUP.XXX files, NREST may be unable to restore some files, or some files may be restored incorrectly.

Before using the NREST utility, you should copy the NREST.EXE file from the MS-DOS Backup/Restore Supplemental Utilities disk to a directory on your computer's hard drive that is included in your PATH command. Refer to your MS-DOS user's reference for information on the COPY and PATH commands.

Example
The NREST utility extracts files from the target disk and copies them into the current directory. The command syntax is

nrest <drive:> where is either the letter of the disk drive containing the backup disk or the drive letter and path to a backup directory on a hard drive. For example,

nrest a: will extract files from the backup disk in drive A.

When NREST finds a possible file to extract, it displays the message:

Possible file found: Do you wish to recover this file? (Y/N/Q/A)

Pressing Y causes NREST to attempt to extract the file and write it to the current directory. This will overwrite any file in the current directory with the name.

Pressing N causes NREST to skip this file, taking no action.

Pressing Q quits NREST.

Pressing A causes NREST to attempt to extract the file and write it to the current directory under a different name. This is     particularly useful when extracting files backed up on multiple floppy disks.

Restoring Files That Are Split Across Disks
Often, a file will span two or more backup floppy disks. To restore such files, you must extract each piece under a different name (use the A option) and then combine the pieces into the desired file using the MS-DOS COPY command. For example,

copy /b + <combin.fil> copies the previously extracted files and into a combined file <combin.fil>.

For more information on the COPY command, see the MS-DOS user's reference.

TO OBTAIN THIS APPLICATION NOTE
This Application Note can be obtained by calling Microsoft Product Support Services. The application note is also available in the Software/Data Library and can be found by searching on the keyword PD0315, the Q number of this article, or S13249. PD0315 was archived using the PKWARE file-compression utility.

You can find by.SEA, a self-extracting file, on the following services:

<ul>  Microsoft's World Wide Web Site on the Internet On the www.microsoft.com home page, click the Support icon. Click Knowledge Base, and select the product. Enter kbfile by.SEA, and click GO! Open the article, and click the button to download the file. </li>  Internet (anonymous FTP) ftp ftp.microsoft.com Change to the Softlib/Mslfiles folder. Get by.SEA </li>  Microsoft Download Service (MSDL) Dial (425) 936-6735 to connect to MSDL Download by.SEA </li></ul>

For additional information about downloading, please see the following article in the Microsoft Knowledge Base:

ARTICLE-ID: Q119591 TITLE    : How to Obtain Microsoft Support Files from Online Services If you are unable to access the source(s) listed above, you can have this Application Note mailed or faxed to you by calling Microsoft Product Support Services Monday through Friday, 6:00 A.M. to 6:00 P.M. Pacific time at (425) 637-7098. If you are outside the United States, contact the Microsoft subsidiary for your area.