home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 17
/
CD_ASCQ_17_101194.iso
/
vrac
/
tsbat46.zip
/
PUSHDIRE.BAT
< prev
next >
Wrap
DOS Batch File
|
1993-02-13
|
2KB
|
46 lines
@echo off
echo ┌─────────────────────────────────────────────────────────┐
echo │ Nonresident pushdir (Stores the current directory name) │
echo │ By Prof. Timo Salmi, ts@uwasa.fi, Sat 13-Feb-1993 │
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 [/s]
rem /s is for show, that is the environment variables are echoed
rem If you get an "Out of environment space" message, increase your
rem environment space by using shell configuration in config.sys:
rem Example: shell=c:\bin\command.com /e:1024 /p
rem Store the current directory name into pushdire environment variable
echo @echo off> director.bat
echo set pushdire=%%2>> director.bat
dir | find "Directory"> go.bat
call go
if exist director.bat del director.bat
if exist go.bat del go.bat
rem Store the current drive name into pushdire environment variable
cd \
echo @echo off> director.bat
echo set pushdriv=%%2>> director.bat
dir | find "Directory"> go.bat
call go
if exist director.bat del director.bat
if exist go.bat del go.bat
rem Restore the original directory
cd %pushdire%
rem Show if asked
for %%s in (s S) do if "%1"=="/%%s" echo Pushed directory %pushdire%
for %%s in (s S) do if "%1"=="/%%s" echo Pushed drive %pushdriv%
:_out
echo on