可以使用以下步骤来批量自动化设置操作系统默认浏览器:

  1. 创建一个 PowerShell 脚本文件,例如 Set-DefaultBrowser.ps1。

  2. 在脚本文件中使用以下 PowerShell 命令来设置默认浏览器:

$browserPath = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" #设置浏览器路径
$browserName = "Google Chrome" #设置浏览器名称
$regKey = "HKLM:\SOFTWARE\Classes\http\shell\open\command" #设置注册表路径
Set-ItemProperty -Path $regKey -Name "(Default)" -Value "$browserPath \"%1\"" #设置默认浏览器
Set-ItemProperty -Path $regKey -Name "DelegateExecute" -Value $null #禁用委托执行
$regKey = "HKLM:\SOFTWARE\Classes\https\shell\open\command" #设置注册表路径
Set-ItemProperty -Path $regKey -Name "(Default)" -Value "$browserPath \"%1\"" #设置默认浏览器
Set-ItemProperty -Path $regKey -Name "DelegateExecute" -Value $null #禁用委托执行
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice" -Name "Progid" -Value "ChromeHTML" #设置浏览器关联
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice" -Name "Progid" -Value "ChromeHTML" #设置浏览器关联
  1. 将浏览器路径和名称更改为所需的浏览器。

  2. 在 PowerShell 中运行脚本文件,以设置默认浏览器。

  3. 将脚本文件复制到每台要设置默认浏览器的计算机上,并在每台计算机上运行脚本文件

如何批量自动化设置操作系统默认浏览器操作系统版本为windows server 2016。

原文地址: https://www.cveoy.top/t/topic/hkJD 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录