[net.micro.pc] How to restore to a relative directory

reintom@rocky2.UUCP (Tom Reingold) (09/16/86)

======== This is a self-describing sentence. ======== 

The BACKUP and RESTORE programs that come with PC-DOS have
some problems. One of the more obvious ones is that you
cannot restore files to a directory other that the directory
they were in.  The path names are absolute and you can not
make them relative to anything, such as the directory from
which you backed up or the one to which you are restoring.
The version of RESTORE that I have has partially addressed
this problem.  I have MS-DOS for the Zenith computers.  It
has a /F switch that will restore to the current directory
but it will not do so hierarchically. It just puts all the
files on the backup into the current directory.

I HAVE A TRICK TO FIX THIS.  It works with my tape drive too
since it fools DOS, not just RESTORE.  Here is the trick.

Choose a letter that does not correspond to a real physical
drive on your system.  Hypothetically, I will use drive E:.
I am also assuming that your hard disk is drive C:.  (Your
CONFIG.SYS file may need to be modified to allow this. the
statement LASTDRIVE=Z will allow you to use any letter in
the alphabet.)  Now use these commands.

     c:                       (set the default drive to c:)
     cd \                     (avoid possible conflicts)
     mkdir tmp                (do this if you don't have a \tmp)
     subst e: \tmp            (make c:\tmp appear to be drive e:)
     assign c=e               (make i/o for drive c: go to drive e:)

Now when something is to be written into the root directory,
it will be diverted to the \tmp directory.  Everything that
is normally below root with be below \tmp.  You can use the
command

     restore a: c:*.*/s

to restore the entire backup to the \tmp directory.  You may
not have room on your drive for this.  To restore your dBase
directory only, you may type

     restore a: c:\dbase\*.*/s

One problem with this method is that if you keep your DOS
programs on your hard disk, DOS cannot find them on your
disk using the path variable or even if you specify the path
on the command line.  This is because you have fooled it
about what the root directory is.  You may have to keep your
DOS disk in drive B: and prepend a "b:" to your DOS
commands.

After you restore, make everything normal by putting a DOS
disk in drive A: and type

     a:assign
     a:subst e: /d

You must put in that space before the slash in the latter
command.

--
Tom Reingold
UUCP:
     seismo|
    philabs|
       phri| -> cmcl2!rna!rocky2!reintom
    harvard|
      ihnp4|

ARPANET:        reintom@rockefeller.arpa
BITNET:         REINTOM@ROCKVAX