Metropoli BBS
VIEWER: file-cd.bat MODE: TEXT (ASCII)
:: searchs subdirectories for a file and offers list of
:: found files for the changing of directory to directory of
:: selected file.
m/set f=[ucase`[?Enter file name to search for]]
if errorlevel 5 goto fin
dir %f% /s/b >$file_cd
m/set s=[getfsize`$file-cd]
if %s%==0 goto not
select /t:"Select directory to change to" /set:f<$file-cd
if errorlevel 5 goto fin
:: change to disk drive
m/xqt [p`\`[e`f]``nul]
:: change directory
m/xqt cd [ss`[e`f]`1`[[pos`[fname`[f]]`[f]]`sub`1]].
goto fin
:not
echo %f% is not found.
:fin

[ RETURN TO DIRECTORY ]