原文地址:https://titusfortner.com/2022/09/28/edge-ie-mode.html

Internet Explorer 已死! IE 模式万岁。 Selenium 不再支持独立浏览器,但它支持在 IE 模式下执行 Microsoft Edge。 我编写了 C++ 代码(第一次!)以使 v4.5 中的 IEDriverServer 更易于使用。 另外,我将展示如何解决两个常见问题。

Windows 10

在 Windows 10 上,您可能同时安装了 IE 和 Edge 浏览器。

Standalone IE

只要您将缩放级别设置为 100% 并使所有保护模式设置相同,就不需要额外的自定义选项来使用独立的 Internet Explorer 运行测试。

阅读全文 »

新建bat文件保存,并以管理员模式运行。

Hyper-V.bat
pushd "%~dp0"

dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hv.txt

for /f %%i in ('findstr /i . hv.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"

del hv.txt

Dism /online /enable-feature /featurename:Microsoft-Hyper-V -All /LimitAccess /ALL

Pause

问题:Windows10虚拟机启动报错:SYSTEM-THREAD-EXCEPTION-NOT-HANDLED

场景:虚拟机从A设备的VMware导出,然后导入B设备的VMware,启动之后发生的。

解决:将处理器设置为 1-2 的配置,即可成功启动

或者将脚本保存为 disable-edge-auto-update.ps1 文件,右键点击 “使用 PowerShell 运行”

disable-edge-auto-update.ps1
if ([Environment]::Is64BitOperatingSystem -eq "True") {
#Write-Host "64-bit OS"
$PF=${env:ProgramFiles(x86)}
}
else {
#Write-Host "32-bit OS"
$PF=$env:ProgramFiles
}

if ($(Test-Path "$PF\Microsoft\Edge\Application\msedge.exe") -eq "True") {
# 结束进程
taskkill /im MicrosoftEdgeUpdate.exe /f
taskkill /im msedge.exe /f
# Microsoft Edge 更新服务 (sysin)
#这里也可以使用 sc.exe stop "service name"
Stop-Service -Name "edgeupdate"
Stop-Service -Name "edgeupdatem"
Stop-Service -Name "MicrosoftEdgeElevationService"
# Windows 10 默认 PS 版本 5.1 没有 Remove-Service 命令
# This cmdlet was added in PS v6. See https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-core-60?view=powershell-6#cmdlet-updates.
#Remove-Service -Name "edgeupdate"
#Remove-Service -Name "edgeupdatem"
#Remove-Service -Name "MicrosoftEdgeElevationService"
# sc 在 PowerShell 中是 Set-Content 别名,所以要使用 sc.exe 否则执行后无任何效果
sc.exe delete "edgeupdate"
sc.exe delete "edgeupdatem"
sc.exe delete "MicrosoftEdgeElevationService"
# 任务计划企业版
#schtasks.exe /Delete /TN \MicrosoftEdgeUpdateBrowserReplacementTask /F
#schtasks.exe /Delete /TN \MicrosoftEdgeUpdateTaskMachineCore /F
#schtasks.exe /Delete /TN \MicrosoftEdgeUpdateTaskMachineUA /F
Get-ScheduledTask -taskname MicrosoftEdgeUpdate* | Unregister-ScheduledTask -Confirm: $false
# 移除更新程序
Remove-Item "$PF\Microsoft\EdgeUpdate" -Recurse -Force
Write-Output "Disable Microsoft Edge Enterprise Auto Update Successful!"
}
elseif ($(Test-Path "$env:USERPROFILE\AppData\Local\Microsoft\Edge\Application\msedge.exe") -eq "True") {
# 结束进程
taskkill /im MicrosoftEdgeUpdate.exe /f
taskkill /im msedge.exe /f
# 用户版没有创建服务
# 获取SID方法
function Get-CurrentUserSID {
[CmdletBinding()]
param(
)
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
return ([System.DirectoryServices.AccountManagement.UserPrincipal]::Current).SID.Value
}
# 用户版任务计划
schtasks.exe /Delete /TN \MicrosoftEdgeUpdateTaskUser$(Get-CurrentUserSID)Core /F
schtasks.exe /Delete /TN \MicrosoftEdgeUpdateTaskUser$(Get-CurrentUserSID)UA /F
#Get-ScheduledTask -taskname MicrosoftEdgeUpdate* | Unregister-ScheduledTask -Confirm: $false
# 移除更新程序
Remove-Item "$env:USERPROFILE\AppData\Local\Microsoft\EdgeUpdate" -Recurse -Force
Write-Output "Disable Microsoft Edge Users Setup Auto Update Successful!"
}
else {
Write-Output "No Microsoft Edge Installation Detected!"
}