![]() |
中国DOS联盟-- 联合DOS 推动DOS 发展DOS --联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum |
| 游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟 |
|
中国DOS联盟论坛 现在时间是 2026-08-11 05:58 |
共 47,811 主题排行 / 349,897 发帖 / 今日 0 篇 / 48,256 会员排行 |
| DOS批处理 & 脚本技术(批处理室) » [原创]文件查找工具 |
| 可打印版本 896 / 1 |
| 第1楼 junchen2 | 发表于 2007-09-29 16:50 |
| 高级用户 发帖 219 积分 537 来自 杭州--半山 | |
|
[原创]文件查找工具 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 ] |
|
| 第2楼 DJ131452DJ | 发表于 2009-01-23 12:43 |
| 初级用户 发帖 44 积分 50 | |
|
谢谢了
|
|
|
[ 联系联盟系统管理团队 -
中国DOS联盟 -
标准版 ] Sponsored by ifanr Inc | © 2001–2023 |