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 13:10
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » The most basic questions are also what novices care about the most View 2,157 Replies 17
Floor 16 Posted 2006-11-23 10:59 ·  中国 广西 南宁 电信
中级用户
★★
Credits 252
Posts 56
Joined 2003-12-29 00:00
22-year member
UID 14605
Gender Male
Status Offline
The code in FIND.BAT:
for %%a in (*.txt) do @find "baidu" %%a
pause
exit
Runs successfully when placed in %systemboot%\system32\, but not when placed elsewhere
Floor 17 Posted 2006-11-23 11:04 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Oh, I see. Hehe... Fun~ : )
Why did you name the FIND.BAT batch file the same as the FIND.EXE you want to call except for the extension?

When you call it, you don't write their extensions. FIND.BAT and FIND.EXE have different execution priorities~
And it's related to the current directory where you execute the batch file. The system will look for it here first...
In this case, there will be very interesting problems : )

If you really don't want to change the batch file name, then you can only do...do @find.exe "baidu" ...
Let the Windows system know that you are calling the find.exe file.

It's best to rename your find.bat file.

[ Last edited by redtek on 2006-11-22 at 10:14 PM ]
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 18 Posted 2006-11-23 11:06 ·  中国 广西 南宁 电信
中级用户
★★
Credits 252
Posts 56
Joined 2003-12-29 00:00
22-year member
UID 14605
Gender Male
Status Offline
Thanks, it worked! I thought it would be as complicated to set up as JAVA
Forum Jump: