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-07-31 22:26
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Search for the HOSTS file and insert lines View 3,627 Replies 16
Floor 16 Posted 2008-09-24 14:05 ·  中国 北京 联通
初级用户
Credits 36
Posts 19
Joined 2007-12-29 10:53
18-year member
UID 107102
Gender Male
Status Offline
I also put a reference up.. Because the configuration system made one
@echo off
setlocal enabledelayedexpansion
echo Y|cacls %windir%\system32\drivers\etc\hosts /g everyone:f
attrib -r -a -s -h %windir%\system32\drivers\etc\hosts
color 0A
echo.>> %windir%\system32\drivers\etc\hosts
FOR /F "eol=# tokens=1 delims=" %%i in (LIST.txt) do (
FIND "%%i" %windir%\system32\drivers\etc\hosts
IF errorlevel 1 @echo %%i >> %windir%\system32\drivers\etc\hosts
)

@echo on
@echo Press any key to exit the installation program
@echo. & pause 1>nul 2>nul
Floor 17 Posted 2008-09-24 14:05 ·  中国 北京 联通
初级用户
Credits 36
Posts 19
Joined 2007-12-29 10:53
18-year member
UID 107102
Gender Male
Status Offline
Template for list.txt:
10.96.100.55 mismidt01.pec.com.cn
10.96.100.56 mismidt02.pec.com.cn
10.96.100.57 mismidt03.pec.com.cn
Forum Jump: