1,上面的那个就是多了一句 && @(cls && echo%%d) ,这样就会在输出到result.txt文件的同时也在屏幕上显示正在枚举的文件名.
2,想不显示路径可以用%%~nxd,另外最好加一个对result.txt文件做个删除处理.
代码如下:
@echo off
@mode con:cols=80 lines=8
@title 枚举并适时显示
@color 71
@echo   正在枚举中..........
if exist result.txt @del result.txt /f/q
@for /r %%d in (*.*) do @(
              @echo %%~nxd >>result.txt && @(cls && echo%%~nxd) 
      )                             
@title 枚举并适时显示  
@start result.txt  
@echo.  
@echo   OK,完成 正在退出..........
@dir %windir% /a /s>nul
exit
 Last edited by hxuan999 on 2006-12-20 at 10:00 PM ]