home *** CD-ROM | disk | FTP | other *** search
- SETDIR Use to restore the current directory
-
- SETDIR sets the environment string 'CURDIR' with the current directory. Once
- this has been done it is very simple to restore the current directory after it
- has been changed. To restore the current directory, simply issue the following
- command:
-
- CD %CURDIR%
-
- This technique has distinct advantages over other techniques that create files
- (i.e. CD >CURDIR.FIL) or modify the interupt vector (PUSHDIR/POPDIR from PC
- magazine and PC OUTLINE). It is much faster, creates no files, cannot be
- impacted by programs that modify the interrupt vector, and requires only
- one very small program.
-
- If you desire setting another environment variable, use the following:
-
- SETDIR
- SET name=%CURDIR%
-
- Note that due to limitations in DOS, the errorlevel can be 0 even if
- SETDIR fails due to lack of environment space. Errorlevels 1 and 2
- are for SETDIR errors. Errorlevel=1 means the DOS release is not at least 2.
- Errorlevel=2 means that the directory string was too long to return.