![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-02 01:26 |
48,037 topics / 350,122 posts / today 2 new / 48,250 members |
| DOS批处理 & 脚本技术(批处理室) » .bat experts and Wengier, Sandy come in |
| Printable Version 1,834 / 9 |
| Floor1 jgty727 | Posted 2005-08-14 22:11 |
| 新手上路 Posts 6 Credits 17 | |
|
The speed of the current website is really slow. I can't access the previous name. I don't know what's going on.
I want to ask a question: How to write a.bat hard disk search program? For example, there is qq.exe in the computer, but I don't know where it is. Once the program is written and run, it can search for the qq.exe file in the hard disk by itself and run it. I don't know if this idea is feasible. I hope for your guidance. |
|
| Floor2 johnsonlam | Posted 2005-08-15 09:44 |
| 银牌会员 Posts 497 Credits 1,410 From 九龍,香港 | |
Originally posted by jgty727 at 2005-8-14 10:11 PM: It's not slow. I come in from Hong Kong and it's very fast. Maybe someone near you is normally transferring some DVD ISO files ![]() ![]() The simplest search should be using dir. For example: 1) cd \ (If you don't know where it is, start from the root directory) 3) dir /s qq.exe (If you know it's in the dos subdirectory, you can use dir c:\dos\qq.exe) If you know approximately where it is, you can enter or specify the subdirectory, such as dir c:\dos /s, which is more time-saving. To write it into a bat: @echo off dir /s %1 [ Last edited by johnsonlam on 2005-8-15 at 09:55 ] |
|
| Floor3 zybird | Posted 2005-10-19 21:23 |
| 中级用户 Posts 53 Credits 240 | |
|
What system are you using?
|
|
| Floor4 不得不爱 | Posted 2005-10-20 09:26 |
| 超级版主 Posts 2,044 Credits 5,310 From 四川南充 | |
|
Any system is okay
|
|
| Floor5 zybird | Posted 2005-10-22 21:17 |
| 中级用户 Posts 53 Credits 240 | |
|
If the LZ is not using XP or 2000, I can recommend a small program I made ~~~~~~~~
|
|
| Floor6 maya0su | Posted 2005-12-06 20:29 |
| 中级用户 Posts 131 Credits 241 | |
|
The LZ's meaning is not like that. His meaning should be like this: I don't know where the specific directory of qq.exe is. Enter.bat directly in the root directory of DOS and then enter the variable name qq.exe, and then.bat will automatically find qq.exe and run it! That's it! I think it can't be realized because I tried it before. It really doesn't work. I don't know who can solve this problem? Is it very amazing that there is a.bat file that can search the entire disk?
|
|
| Floor7 yiwangzhiren | Posted 2006-09-15 05:29 |
| 新手上路 Posts 4 Credits 12 | |
|
for /f %%a in ('dir /a /s /b c:\qq.exe') do if not "%%a"=="" %%a&exit /b
for /f %%a in ('dir /a /s /b d:\qq.exe') do if not "%%a"=="" %%a&exit /b for /f %%a in ('dir /a /s /b e:\qq.exe') do if not "%%a"=="" %%a&exit /b exit /b See if this works [ Last edited by yiwangzhiren on 2006-9-15 at 05:34 ] |
|
| Floor8 electronixtar | Posted 2006-09-15 06:09 |
| 铂金会员 Posts 2,672 Credits 7,493 | |
|
http://www.cn-dos.net/forum/viewthread.php?tid=16518&fpage=1&highlight=
[ Last edited by electronixtar on 2006-9-15 at 07:06 ] |
|
| Floor9 vkill | Posted 2006-09-15 06:10 |
| 金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽 | |
|
Old post, this can be achieved
|
|
| Floor10 GOTOmsdos | Posted 2006-09-15 09:01 |
| 铂金会员 Posts 1,827 Credits 5,154 | |
|
<Only runs on 2k/xp>
Main BAT: (qq.bat) @echo off :loop if #%1==# goto end for /r %1 %%a in (qq.exe) do if exist %%a %%a && goto end shift goto loop :end Call main BAT: (callqq.bat) @echo off qq.bat c: d: e: When executing: callqq.bat ×××××××××××××××××××××× Originally wanted to use a variable instead of the path after /R, but it doesn't seem to support it, so I can only make two files (using %1) [ Last edited by GOTOmsdos on 2006-9-15 at 09:14 ] |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |