这个ECHO还真是关键呢..
终于成功地运用了DOS的变量嵌套!从而解决了通过"递减和递增"简化了WBAT的简易DOS浏览器!!!
"递减和递增"简化是最简化的...(写出来的变量只用了区区三个!,小小WBAT和GET就实现了浏览几乎无限制的深层目录及其文件!,也可顺带编辑文本文件,执行可执行程序,批处理程序,也可随时把用户的目录赋给一个变量....麻雀虽小,五脏具全..并且支持带间隔的长名目录和中文!) 共大家参考,尤其是学习WBAT和GET的...相信会有很大帮助的!..
很满意! 再次感谢WILLSORT!
简化了的WBAT如下<img src="images/smilies/face-sad.png" align="absmiddle" border="0">DOS71下测试成功!) 要求: 加载DOSLFN,正确加载TW
@echo off
goto begin
:dirbars "上一级—→"
:
:filebars " 上一级—→"
:
:begin
if exist drive.txt copy drive.txt dir0.txt>nul
if exist dir0.txt goto 0dir
wbat cls ! box "没有驱动器!" 退出
goto end
:0dir
set get=0
:dir0
call w.bat list dir%get%.txt
if errorlevel 100 goto end
:putdisk
if not exist notready.txt goto dirbar1
find /i "%wbat%" notready.txt>nul
if errorlevel 1 goto dirbar1
wbat box "您还没有在%wbat%盘放入盘片!" 重试
call diskfind
goto putdisk
:dirbar1
set get=1
set dir%get%=%wbat%
:dirbars1
wbat box @%0:dirbars
if errorlevel 100 goto dirbsub1
if errorlevel 4 goto dir1
if errorlevel 3 goto flist1
if errorlevel 2 goto pikdir1
goto end
:dir1
if %get%==0 goto dir0
if %get%==1 goto rootdir
echo @echo off>nestvar.bat
echo dir "%%dir%get%%%" /b/ad/one>>nestvar.bat
command /c call nestvar>dir%get%.txt
goto subdir
:rootdir
dir %dir1%\ /b/ad/one>dir1.txt
:subdir
get f dir%get%.txt /vfsize>nul
if not "%fsize%"=="0" goto dir1y
wbat box "没有子目录!" 上一级,退出
if errorlevel 2 goto end
goto dirbars1
:dir1y
call w.bat list dir%get%.txt
if errorlevel 100 goto dirbars1
get r "+" %get% /w1 /vgetadd1>nul
echo set dir%getadd1%=%%dir%get%%%\%wbat%>nestvar.bat
call nestvar
wbat box @%0:dirbars
if errorlevel 100 goto dir1y
if errorlevel 4 goto dir2
if errorlevel 3 goto flist2
if errorlevel 2 goto pikdir2
goto end
:flist1
if %get%==1 goto rootfile
echo @echo off>nestvar.bat
echo dir "%%dir%get%%%" /b/a-d/one>>nestvar.bat
command /c call nestvar>flist%get%.txt
goto subfile
:rootfile
dir %dir1%\ /b/a-d/one>flist1.txt
:subfile
get f flist%get%.txt /vfsize>nul
if not "%fsize%"=="0" goto flist1y
wbat box "没有文件!" 上一级,退出
if errorlevel 2 goto end
goto dirbars1
:flist1y
call w.bat list flist%get%.txt
if errorlevel 100 goto dirbars1
:fbars1
wbat box @%0:filebars
if errorlevel 100 goto flist1y
if errorlevel 5 goto info1
if errorlevel 4 goto text1
if errorlevel 3 goto exec1
if errorlevel 2 goto bat1
goto end
:info1
echo @echo off>nestvar.bat
echo dir "%%dir%get%%%\%wbat%" /a>>nestvar.bat
command /c call nestvar>info1.txt
wbat list info1.txt
goto fbars1
:text1
echo @echo off>nestvar.bat
echo edit "%%dir%get%%%\%wbat%">>nestvar.bat
call nestvar
goto fbars1
:exec1
echo @echo off>nestvar.bat
echo "%%dir%get%%%\%wbat%">>nestvar.bat
call nestvar
goto fbars1
:bat1
echo @echo off>nestvar.bat
echo "%%dir%get%%%\%wbat%">>nestvar.bat
call nestvar
goto fbars1
:pikdir1
echo @echo off>nestvar.bat
echo set gamesave=%%dir%get%%%>>nestvar.bat
call nestvar
goto end
:dirbsub1
get r "-" %get% /w1>nul
goto dir1
:dir2
get r "+" %get% /w1>nul
goto dir1
:flist2
get r "+" %get% /w1>nul
goto flist1
:pikdir2
get r "+" %get% /w1>nul
goto pikdir1
:end