@echo 127.0.0.1 baidu.com C:\Windows\System32\Drivers\etc\hosts
这样就是换一行写入。
如果还想换一行,就写:
复制代码 代码如下:
@echo. C:\Windows\System32\Drivers\etc\hosts
@echo 127.0.0.1 baidu.com C:\Windows\System32\Drivers\etc\hosts
@echo 192.168.4.201 ibmrac1 C:\Windows\System32\Drivers\etc\hosts
@echo 192.168.4.202 ibmrac2 C:\Windows\System32\Drivers\etc\hosts
@echo 192.168.4.203 vip-ibmrac1 C:\Windows\System32\Drivers\etc\hosts
@echo 192.168.4.204 vip-ibmrac2C:\Windows\System32\Drivers\etc\hosts
@echo 172.16.1.53 ssosvrC:\Windows\System32\Drivers\etc\hosts
复制代码 代码如下:
@echo off
set stHosts=172.16.1.53 ssosvr
FOR /F "eol=# tokens=1 delims=" %%i in (%systemroot%\system32\drivers\etc\hosts) do if "%stHosts%"=="%%i" exit
echo %stHosts% %systemroot%\system32\drivers\etc\hosts
由于测试需要经常修改本机host,可以用脚本修改:
分别做两个批处理,一个内网,一个外网,用的时候切换运行即可
如内网.bat
复制代码 代码如下:
cd /d %windir%\system32\drivers\etc
del hosts.bak //删除原来备份文件
ren hosts hosts.bak //备份现在host
for /f "eol=# tokens=1,2" %%i in (hosts.bak) do call :checkvalue %%i %%j
goto end
:checkvalue
echo %2 | find /i "szshequ.com" //寻找制定记录删除
if %errorlevel%==1 (echo %1 %2 hosts)
:end
type C:\WINDOWS\system32\drivers\etc\hosts
type C:\WINDOWS\system32\drivers\etc\hosts | find "szshequ.com" && goto yes
::echo 192.168.2.188 szshequ.com ""
echo 192.168.2.188 szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 www.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 bbs.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 cost.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 pp.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 yh.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 club.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 shop.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 images.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 files.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 ajax.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
这样就是换一行写入。
如果还想换一行,就写:
复制代码 代码如下:
@echo. C:\Windows\System32\Drivers\etc\hosts
@echo 127.0.0.1 baidu.com C:\Windows\System32\Drivers\etc\hosts
@echo 192.168.4.201 ibmrac1 C:\Windows\System32\Drivers\etc\hosts
@echo 192.168.4.202 ibmrac2 C:\Windows\System32\Drivers\etc\hosts
@echo 192.168.4.203 vip-ibmrac1 C:\Windows\System32\Drivers\etc\hosts
@echo 192.168.4.204 vip-ibmrac2C:\Windows\System32\Drivers\etc\hosts
@echo 172.16.1.53 ssosvrC:\Windows\System32\Drivers\etc\hosts
复制代码 代码如下:
@echo off
set stHosts=172.16.1.53 ssosvr
FOR /F "eol=# tokens=1 delims=" %%i in (%systemroot%\system32\drivers\etc\hosts) do if "%stHosts%"=="%%i" exit
echo %stHosts% %systemroot%\system32\drivers\etc\hosts
由于测试需要经常修改本机host,可以用脚本修改:
分别做两个批处理,一个内网,一个外网,用的时候切换运行即可
如内网.bat
复制代码 代码如下:
cd /d %windir%\system32\drivers\etc
del hosts.bak //删除原来备份文件
ren hosts hosts.bak //备份现在host
for /f "eol=# tokens=1,2" %%i in (hosts.bak) do call :checkvalue %%i %%j
goto end
:checkvalue
echo %2 | find /i "szshequ.com" //寻找制定记录删除
if %errorlevel%==1 (echo %1 %2 hosts)
:end
type C:\WINDOWS\system32\drivers\etc\hosts
type C:\WINDOWS\system32\drivers\etc\hosts | find "szshequ.com" && goto yes
::echo 192.168.2.188 szshequ.com ""
echo 192.168.2.188 szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 www.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 bbs.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 cost.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 pp.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 yh.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 club.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 shop.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 images.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 files.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
echo 192.168.2.188 ajax.szshequ.com C:\WINDOWS\system32\drivers\etc\hosts
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com
暂无评论...
更新日志
2024年09月23日
2024年09月23日
- 国风大师纯音系列《古筝仙子 常静演奏 十指弹一》1CD[FLAC][919MB]
- DasKapital-OneMustHaveChaosInsidetoGiveBirthtoaDancingStar(2024)[24-44.1]WAV
- 王菲.1999-《只爱陌生人》日本东芝版[低速原抓WAV+CUE]
- 张小英1987-金奖金曲第一集[新加坡版][WAV+CUE]
- 鹿晗.2015-重启【海蝶】【FLAC分轨】
- 张芸京.2012-小女孩【金牌大风】【WAV+CUE】
- 余天.2002-雄狮魅力金曲2CD(南方金点系列)【南方】【WAV+CUE】
- 银霞.1982-《结·SAYYESMYBOY》台湾复刻版[WAV+CUE]
- 梁汉文1993-火热动感[引进版][WAV+CUE]
- 梁汉文2008-EDMONDHITS48[香港]3CD[WAV+CUE]
- 国风大师纯音系列《童丽-[渭城曲]》1CD[WAV分轨][593.5MB]
- 国风大师纯音系列《许菱子《烧筝2》古筝曲集》1CD[WAV分轨][1.3GB]
- 王子异《1996 Part.2》[320K/MP3][18.29MB]
- 群星.1994-宝丽金最倾情3CD【宝丽金】【WAV+CUE】
- 乐俊亨.2024-同泪【CharioticMusic】【FLAC分轨】