Microsoft Edge浏览器批处理设置主页方法

查看 143|回复 14
作者:furui023   
Microsoft Edge浏览器批处理或注册表设置主页方法,想设置成自己的主页,进浏览器设置太麻烦了

批处理, 主页, 自己的

石斑鱼   
powshell脚本
[ol]$regPath = "HKCU:\Software\Microsoft\Edge\BLBeacon\settings"
$homePageKey = "HomePage"
$homePageValue = "ht tp  s:   // www .exam ple.com"
if (-not (Test-Path $regPath)) {
    New-Item -Path $regPath -Force | Out-Null
}
Set-ItemProperty -Path $regPath -Name $homePageKey -Value $homePageValue
[/ol]复制代码
石斑鱼   
   
编写一个.reg文件或PowerShell脚本,自动导入注册表设置。示例.reg文件内容:
[ol]Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge]
"HomepageLocation"="https://www.example.com"
"OpenHomepageOnStart"=dword:00000001[/ol]复制代码
[ol]@echo off
reg add "HKLM\SOFTWARE\Policies\Microsoft\Edge" /f /v "HomepageLocation" /t REG_SZ /d "https://www.example.com"
reg add "HKLM\SOFTWARE\Policies\Microsoft\Edge" /f /v "OpenHomepageOnStart" /t REG_DWORD /d 1
exit[/ol]复制代码
石斑鱼   
[ol]# 设置注册表路径(官方推荐路径)
$regPath = "HKCU:\Software\Policies\Microsoft\Edge"
$homePageKey = "HomepageLocation"
$openOnStartKey = "OpenHomepageOnStart"
$homePageValue = "https://www.example.com"
# 检查注册表路径是否存在,如果不存在则创建
if (-not (Test-Path $regPath)) {
    try {
        New-Item -Path $regPath -Force | Out-Null
        Write-Host "注册表路径已创建:$regPath"
    }
    catch {
        Write-Error "无法创建注册表路径:$regPath。请以管理员身份运行 PowerShell。"
        exit
    }
}
# 设置主页地址
try {
    Set-ItemProperty -Path $regPath -Name $homePageKey -Value $homePageValue -Force
    Write-Host "主页已设置为:$homePageValue"
}
catch {
    Write-Error "无法设置主页键值:$homePageKey"
}
# 启用启动时打开主页
try {
    Set-ItemProperty -Path $regPath -Name $openOnStartKey -Value 1 -Force
    Write-Host "已启用:启动时打开主页"
}
catch {
    Write-Error "无法设置启动时打开主页键值:$openOnStartKey"
}[/ol]复制代码
石斑鱼   

a66 发表于 2026-2-25 10:20

感谢分享!
石斑鱼   
我将 3# 转为:批处理
@echo off
reg add "HKLM\SOFTWARE\Policies\Microsoft\Edge" /f /v "HomepageLocation" /t REG_SZ /d "https://www.example.com"
reg add "HKLM\SOFTWARE\Policies\Microsoft\Edge" /f /v "OpenHomepageOnStart" /t REG_DWORD /d 1
exit
石斑鱼   
不错不错!!!!!!
石斑鱼   
学习了,那QQ浏览器如何设置呢?有没有大神知道的。
石斑鱼   

yyz2191958 发表于 2026-2-25 10:57
我将 3# 转为:批处理
@echo off
reg add "HKLM\SOFTWARE\Policies\Microsoft\Edge" /f /v "HomepageLoca ...

謝謝分享,非常感謝您!
石斑鱼   
都是进设置菜单弄一下
您需要登录后才可以回帖 登录 | 立即注册

返回顶部