2017-10-21 18:00:10 +00:00
|
|
|
@echo off
|
|
|
|
rem Change working dir in cmd.exe to last dir in lf on exit.
|
|
|
|
rem
|
|
|
|
rem You need to put this file to a folder in %PATH% variable.
|
|
|
|
|
|
|
|
:tmploop
|
|
|
|
set tmpfile="%tmp%\lf.%random%.tmp"
|
2019-08-28 17:05:18 +00:00
|
|
|
if exist %tmpfile% goto:tmploop
|
|
|
|
lf -last-dir-path=%tmpfile% %*
|
|
|
|
if not exist %tmpfile% exit
|
|
|
|
set /p dir=<%tmpfile%
|
|
|
|
del /f %tmpfile%
|
2017-10-21 18:00:10 +00:00
|
|
|
if not exist "%dir%" exit
|
|
|
|
if "%dir%" == "%cd%" exit
|
2019-08-28 17:05:18 +00:00
|
|
|
cd /d "%dir%"
|