home *** CD-ROM | disk | FTP | other *** search
- echo off
- echo Nonresident pushdir (Stores the current directory name)
- echo By Prof. Timo Salmi, ts@chyde.uwasa.fi, Fri 6-Dec-1991
- if "%1"=="" echo.
-
- rem Saves the current drive and directory names in pushdriv and
- rem pushdire environment variables.
-
- rem After changing directory, you can pop back to the original
- rem drive and directory by applying popdire.bat.
-
- rem usage PUSHDIRE [/q]
- rem /q is for quiet, that is the environment variables are not
- rem echoed
-
- rem If you get an "Out of environment space" message, increase your
- rem environment space by using shell configuration in config.sys:
- rem MsDos 3.30 example: shell=c:\bin\command.com /e:1024 /p
-
- rem Requires the setpushd.exe program at path
- set _found=
- if exist setpushd.exe set _found=yes
- for %%d in (%path%) do if exist %%d\setpushd.exe set _found=yes
- if not "%_found%"=="yes" goto _no_exe
-
- rem Let's do it
- set _found=
- setpushd %1
- if errorlevel==1 goto _err
- pushd$$$
- rem if you have MS-DOS 3.3 you may use the following command instead
- rem of pushd$$$: call pushd$$$
- goto _out
-
- :_err
- echo File access error: Failed to push the drive and directory
- goto _out
-
- :_no_exe
- echo SETPUSHD.EXE must be in the present directory or at path.
- goto _out
-
- :_out
- echo on
-