标题: [网络连接] 批处理主页修改器(强制版)为何无效? [打印本页]
作者: LJY4.0 时间: 2022-4-26 19:40 标题: 批处理主页修改器(强制版)为何无效?
有哪位大神能帮我找错,强制更改主页无效,找不出- @echo off
- title 主页修改器(强制版)_LJY4.0
- color a
- for /f "tokens=2 delims=Z" %%i in ('Reg Query "HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main" /v "Start Page" ') do (
- echo 请确保现在的主页是恶意网址
- echo 目前主页:
- echo %%i
- echo.
- echo.
- echo.
- )
- echo 1.普通更改 2.强制更改(谨慎使用)
- set /p Mode=^>^>
- if "%Mode%"=="1" goto RH
- if "%Mode%"=="2" goto RHH
- exit
- :RH
- echo 格式:http://www.baidu.com
- set /p Https=您希望的网址:
- REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /t REG_SZ /d http://www.baidu.com /f
- echo 修改完成!如不行使用强制更改
- pause>nul
- exit
- :RHH
- cls
- echo.
- echo 1.还原 2.强制更改主页
- echo.
- echo.
- set /p Modes=
- if "%Modes%"=="2" goto KW
- exit
- copy /y %systemroo%\System32\drivers\etc\hosts.FC %systemroo%\System32\drivers\etc\hosts
- echo 还原成功!
- pause>nul
- exit
- :KW
- cls
- echo 格式:http://www.baidu.com
- set /p Https=您希望的网址:
- copy %systemroo%\System32\drivers\etc\hosts %systemroo%\System32\drivers\etc\hosts.FC
- for /f "tokens=2 delims=Z skip=2" %%i in ('Reg Query "HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main" /v "Start Page" ') do echo %%i>https
- )
- for /f "tokens=2-3 delims=/" %%b in (https) do (
- set b=%%b
- for /f "tokens=2 delims=[" %%i in ('ping /n 1 %Https%') do (
- echo %%i>ping
- for /f "delims=]" %%a in (ping) do (
- echo %%a # https://%b%/ %systemroo%\System32\drivers\etc\hosts
- )))
- del /f/q ping
- REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /t REG_SZ /d %Https% /f
- echo 完成!
- pause>nul
- exit
复制代码
作者: ANSL 时间: 2022-12-11 11:49
回复 1# LJY4.0
20行是baidu而不是%https%
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |