中国DOS联盟论坛

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-12 10:05
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » What is the difference between echo. and echo?
Printable Version  2,072 / 5
Floor1 lzpmyth Posted 2010-12-11 18:31
新手上路 Posts 4 Credits 2
Ask everyone

The content in 1.txt is: 123123

The content in 1.bat is:
type 1.txt |find "123123"
echo %ERRORLEVEL%
echo.type 1.txt |find "123123"
echo %ERRORLEVEL%

The result returns 0 and 1, why not 0 and 0??
Floor2 Hanyeguxing Posted 2010-12-11 18:52
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
What is the purpose of the building "echo.type 1.txt"?
Floor3 726842270 Posted 2010-12-12 12:18
初级用户 Posts 43 Credits 65 From 吉林省长春市
I'm not sure what you're up to, but the execution of echo.type 1.txt |find "123123" is wrong, so it returns "1"
type 1.txt |find "123123"
echo %ERRORLEVEL%
echo "type 1.txt |find "123123""
echo %ERRORLEVEL%
pause
Floor4 lzpmyth Posted 2010-12-13 10:45
新手上路 Posts 4 Credits 2
Thanks! Now it's okay.

I want to use HOST to block URLs (block those that pop up a lot of ads when opening a web page)

set list1=.\Website.txt 'Inside are ad URLs
set list2=%windir%\system32\drivers\etc\hosts

for /f "tokens=1,2 delims==" %%i in (%list1%) do (
set Website=%%i
type !list2! |find "!Website!" 1>2>nul
if !ERRORLEVEL! neq 0 (
echo.127.0.0.1 !Website!>>!list2!)
)
Floor5 lzpmyth Posted 2010-12-13 10:46
新手上路 Posts 4 Credits 2
Originally posted by Hanyeguxing at 2010-12-11 18:52:
What is the purpose of the building "echo.type 1.txt"?



Thank you! It's okay now.

I want to use HOST to block URLs (block those annoying ads that pop up as soon as you open a web page)

set list1=.\Website.txt 'Inside are the URLs of ads
set list2=%windir%\system32\drivers\etc\hosts

for /f "tokens=1,2 delims==" %%i in (%list1%) do (
set Website=%%i
type !list2! |find "!Website!" 1>2>nul
if !ERRORLEVEL! neq 0 (
echo.127.0.0.1 !Website!>>!list2!)
)
Floor6 acaigg Posted 2010-12-25 11:52
初级用户 Posts 92 Credits 115
Learning
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023