批处理内容如下:- color 2F
- net session > nul 2>&1
- if not %errorlevel% equ 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"
-
-
- Attrib -R -S "%windir%\system32\drivers\etc\hosts" /S
- SET NEWLINE=^& echo.
-
- Find /C /I "cad.glodon.com" %WINDIR%\system32\drivers\etc\hosts
- IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^127.0.0.2 cdn.cad.glodon.com>>%WINDIR%\system32\drivers\etc\hosts
- IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^127.0.0.2 cad.glodon.com>>%WINDIR%\system32\drivers\etc\hosts
-
- Find /C /I "license.lumiontech.net" %WINDIR%\system32\drivers\etc\hosts
- IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^127.0.0.2 license.lumiontech.net>>%WINDIR%\system32\drivers\etc\hosts
-
- Find /C /I "backup.lumion3d.net" %WINDIR%\system32\drivers\etc\hosts
- IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^127.0.0.2 backup.lumion3d.net>>%WINDIR%\system32\drivers\etc\hosts
- IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^127.0.0.2 license.lumion3d.net>>%WINDIR%\system32\drivers\etc\hosts
- IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^127.0.0.2 backup.lumion3d.com>>%WINDIR%\system32\drivers\etc\hosts
- IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^127.0.0.2 activate.lumion3d.com>>%WINDIR%\system32\drivers\etc\hosts
- IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^127.0.0.2 upload.lumion3d.net>>%WINDIR%\system32\drivers\etc\hosts
- IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^127.0.0.2 upload.lumion3d.com>>%WINDIR%\system32\drivers\etc\hosts
-
- Attrib +R "%windir%\system32\drivers\etc\hosts" /S
- @ipconfig /flushdns
复制代码 单独运行可以修改hosts屏蔽相关网站,但这个批处理被winrar自解压程序调用后(自解压程序勾选了以管理员身份运行也不行),执行就没有效果,无法修改hosts |