lfcd.cmd (327B)
1 @echo off 2 rem Change working dir in cmd.exe to last dir in lf on exit. 3 rem 4 rem You need to put this file to a folder in %PATH% variable. 5 6 :tmploop 7 set tmpfile="%tmp%\lf.%random%.tmp" 8 if exist %tmpfile% goto:tmploop 9 lf -last-dir-path=%tmpfile% %* 10 if not exist %tmpfile% exit 11 set /p dir=<%tmpfile% 12 del /f %tmpfile% 13 cd /d "%dir%"