China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-02 02:26
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » .bat experts and Wengier, Sandy come in View 1,838 Replies 9
Original Poster Posted 2005-08-14 22:11 ·  中国 新疆 克拉玛依 移动
新手上路
Credits 17
Posts 6
Joined 2005-08-14 22:00
20-year member
UID 41658
Status Offline
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.
Floor 2 Posted 2005-08-15 09:44 ·  中国 香港
银牌会员
★★★
阿林
Credits 1,410
Posts 497
Joined 2004-06-28 00:00
22-year member
UID 27551
Gender Male
From 九龍,香港
Status Offline
Originally posted by jgty727 at 2005-8-14 10:11 PM:
The speed of the current website is so 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...


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 ]
我 的 網 站 - http://optimizr.dyndns.org
Floor 3 Posted 2005-10-19 21:23 ·  中国 广东 潮州 电信
中级用户
★★
Credits 240
Posts 53
Joined 2005-01-21 00:00
21-year member
UID 35493
Gender Male
Status Offline
What system are you using?
Floor 4 Posted 2005-10-20 09:26 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Floor 5 Posted 2005-10-22 21:17 ·  中国 广东 潮州 电信
中级用户
★★
Credits 240
Posts 53
Joined 2005-01-21 00:00
21-year member
UID 35493
Gender Male
Status Offline
If the LZ is not using XP or 2000, I can recommend a small program I made ~~~~~~~~
Floor 6 Posted 2005-12-06 20:29 ·  中国 山西 运城 电信
中级用户
★★
Credits 241
Posts 131
Joined 2005-09-28 19:01
20-year member
UID 42920
Gender Male
Status Offline
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?
房东说:这娃是个好孩子!
Floor 7 Posted 2006-09-15 05:29 ·  中国 四川 内江 电信
新手上路
Credits 12
Posts 4
Joined 2006-09-13 05:16
19-year member
UID 62467
Status Offline
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 ]
Floor 8 Posted 2006-09-15 06:09 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
http://www.cn-dos.net/forum/viewthread.php?tid=16518&fpage=1&highlight=

[ Last edited by electronixtar on 2006-9-15 at 07:06 ]

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 9 Posted 2006-09-15 06:10 ·  中国 甘肃 张掖 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Old post, this can be achieved
Floor 10 Posted 2006-09-15 09:01 ·  中国 广东 广州 教育网
铂金会员
★★★★
C++启程者
Credits 5,154
Posts 1,827
Joined 2003-07-18 00:00
23-year member
UID 7105
Gender Male
Status Offline
<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 ]
Forum Jump: