bat脚本会在E:盘下生成findfile文件夹,并有临时文件。请注意
支持通配符
a----选项是打开文件
S---选项是打开文件所在的文件夹
小第水平不高,有不好地方多指教。
@echo off
color 3f
cls
title 文件查找工具 by-junchen2 date-2007-09-28
del /q E:\findfile
:n
@echo 扩 文 路 打开
@echo 展 件 方式
@echo 名 名 径 a s
set /p var=
for /f "tokens=1-4" %%a in ("%var%") do call :f %%a %%b %%c %%d
:f
::setlocal enabledelayedexpansion
cd\
cd /d %3
dir /b /s /a %2.%1>> e:\findfile\list.txt
if errorlevel 1 @echo 再一次查找 & 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
cls
@echo %1 %2 %3 %4
findstr /a:a /n ".*" e:\findfile\list.txt
:c
set /p nub= 输入查找的行号 :
if %4 equ a goto :a
if %4 equ s goto :s
:a
@for /f "tokens=1-3 delims=:" %%a in ('type e:\findfile\sn_list.txt') do echo %%a|findstr "\<%nub%" &&start %%b:%%c && goto :2
:s
@for /f "tokens=1-3 delims=:" %%a in ('type e:\findfile\spn_list.txt') do echo %%a|findstr "\<%nub%" &&start %%b:%%c
:2
ECHO 完成了!!!
pause
goto :c
[ Last edited by junchen2 on 2007-9-29 at 06:54 PM ]