相信论坛上有很多,但都不完整,
大家帮忙统合
还有我是入门级的,莫见笑作者: junchen2 时间: 2007-12-1 22:27 @echo off
color 3f
cls
:1
title 文件查找工具 by-junchen2 date-2007-09-28
del /q E:\findfile
set /p var=n/e/p/o
for /f "tokens=1-4 delims=/" %%a in ("%var%") do call :f "%%a" "%%b" "%%~sc" %%d
:f
if "%~1"=="" echo 参数缺少请再一次输入 & goto :1
if "%~2"=="" echo 参数缺少请再一次输入 & goto :1
if "%~3"=="" echo 参数缺少请再一次输入 & goto :1
if "%~4"=="" echo 参数缺少请再一次输入 & goto :1
cd\
cd /d %3
dir /b /s /a %~1.%~2>> e:\findfile\list.txt
if errorlevel 1 goto :n
for /f "delims=" %%d in (e:\findfile\list.txt) do echo %%~sd >>e:\findfile\s_list.txt
@for /f "delims=" %%e in (e:\findfile\s_list.txt) do echo %%~dpe>>e:\findfile\sp_list.txt
type e:\findfile\list.txt|findstr /n ".*" >>e:\findfile\n_list.txt
type e:\findfile\s_list.txt|findstr /n ".*" >>e:\findfile\sn_list.txt
type e:\findfile\sp_list.txt|findstr /n ".*" >>e:\findfile\spn_list.txt
::-----------^^^将长短名文件列表加入行号输出n_list.txt ,sn_list.txt