Pcbeta远景论坛hosts批处理v3 - 2020.7.11
强烈建议大家下载备用,万一哪天就上不了论坛了呢
基于:https://bbs.pcbeta.com/viewthread-1860335-1-1.html 感谢老师~
本次更新内容(相较于v2):
添加远景论坛IPv6地址(2606:4700:20::ac43:4606)
源代码(欢迎更改):
- title 添加远景Hosts,解决无法访问远景论坛V3 更新时间:2020/07/11 v2 By:PCbeta-〝灬现在· v3 By:PCBeta-qyh1206
- mode con cols=87 lines=15
- @echo off& color 09
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :::::::::::::::::::::::管理员权限开始获取:::::::::::::::::::::::
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
- if '%errorlevel%' NEQ '0' (
- goto UACPrompt
- ) else ( goto gotAdmin )
- :UACPrompt
- echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
- echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
- "%temp%\getadmin.vbs"
- exit /B
- :gotAdmin
- if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ::::::::::::::::::::::::管理员权限结束获取::::::::::::::::::::::
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- echo. 如果系统中安装有安全软件,修改过程中可能遇到安全软件的拦截,请允许运行或退出杀毒软件
- echo. 按任意键进行下一步操作
- @pause > nul
- @echo ——————————————————————————————————————————
- echo 正在备份此前的Hosts文件--复制到C:\Windows\system32\drivers\etc\hosts.bak文件夹目录下
- @xcopy %systemroot%\system32\drivers\etc\hosts %systemroot%\system32\drivers\etc\hosts.bak\ /d /c /i /y
- echo. Hosts文件备份完毕,开始修改Hosts文件
- @echo ——————————————————————————————————————————
- @echo off
- echo.>>%Windir%\system32\drivers\etc\hosts
- echo.^#^ PCbeta START>>%Windir%\system32\drivers\etc\hosts
- @echo 36.27.212.81 pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 36.27.212.81 uc.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 36.27.212.81 m.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 36.27.212.81 mac.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 36.27.212.81 static.template.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 36.27.212.81 web.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 36.27.212.81 i.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 36.27.212.81 bbs.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 36.27.212.81 www.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 36.27.212.81 bbs.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 36.27.212.81 cdn.pcbeta.static.inimc.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 36.27.212.81 cdn.pcbeta.css.inimc.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 36.27.212.81 cdn.pcbeta.img.inimc.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 2606:4700:20::ac43:4606 pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 2606:4700:20::ac43:4606 uc.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 2606:4700:20::ac43:4606 m.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 2606:4700:20::ac43:4606 mac.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 2606:4700:20::ac43:4606 static.template.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 2606:4700:20::ac43:4606 web.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 2606:4700:20::ac43:4606 i.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 2606:4700:20::ac43:4606 bbs.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 2606:4700:20::ac43:4606 www.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 2606:4700:20::ac43:4606 bbs.pcbeta.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 2606:4700:20::ac43:4606 cdn.pcbeta.static.inimc.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 2606:4700:20::ac43:4606 cdn.pcbeta.css.inimc.com >>%systemroot%\system32\drivers\etc\hosts
- @echo 2606:4700:20::ac43:4606 cdn.pcbeta.img.inimc.com >>%systemroot%\system32\drivers\etc\hosts
- echo.^#^ PCbeta END>>%Windir%\system32\drivers\etc\hosts
- @echo off
- echo.>>%Windir%\system32\drivers\etc\hosts
- echo. Hosts文件修改完成
- set file=%systemroot%\system32\drivers\etc\hosts
- @ipconfig /flushdns
- echo.
- echo 写入Hosts成功,将于10秒后关闭本窗口...
- choice /t 10 /d y /n >nul
- ::pause
- exit
复制代码
下载:
远景论坛Hosts修改及恢复程序.zip
(3.08 KB, 下载次数: 273)
https://qyh1206.cowtransfer.com/s/f34c268266a24d
https://qyh1206.lanzous.com/ioWCUeii7vi
注意事项:
1. 在使用前请一定注意安全或杀毒软件弹出的提示框,允许运行或退出安全、杀毒软件以保证此批处理程序有效运行,程序关闭后请打开 运行 (Win+R) 运行引号内容 " notepad % systemroot%\system32\drivers\etc\hosts " 打开 Hosts 确认写入成功。 2. 此批处理只运行一次即可,多次运行会重复写入和备份 Hosts 项目。 3. 备份的 Hosts 文件在 C:\Windows\System32\drivers\etc\hosts.bak 文件夹下,如需恢复 Hosts,复制并覆盖到上级目录 etc\ 下或执行第二条批处理从 Hosts 备份中恢复。 4. 修改 Hosts 后,仍不能正常访问远景论坛,请使用压缩包内所带的原版 Hosts 文件(复制粘贴到 C:\Windows\System32\drivers\etc 文件夹下,弹出的窗口点击继续并替换选中的文件即可)或执行第二条批处理 从 Hosts 备份中恢复,修改完成后建议重启电脑或浏览器、刷新网页。
|