学校的交作业的平台仅允许内网访问,内网DNS解析到10.0.13.10这个地址,但外网公共DNS解析到一个无法访问的公网地址,导致无法访问,现在写一个批处理脚本在hosts中添加一行以解决这个问题

以下是脚本内容
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| @echo off >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" ) pushd "%CD%" CD /D "%~dp0" echo 成功增加"10.0.13.10 eol.bitzh.edu.cn"到hosts echo 10.0.13.10 eol.bitzh.edu.cn 1>>%windir%\System32\drivers\etc\hosts pause exit
|
下载