1 - Thêm hai chức năng sau đây để hồ sơ của bạn PowerShell (C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
)
2 - Chạy Disable-UAC
trong PowerShell
3 - Khởi động lại để thay đổi có hiệu lực. Sử dụng PowerShell, đây sẽ là Restart-Computer -Force -Confirm:$false
Function Test-RegistryValue
{
param(
[Alias("RegistryPath")]
[Parameter(Position = 0)]
[String]$Path
,
[Alias("KeyName")]
[Parameter(Position = 1)]
[String]$Name
)
process
{
if (Test-Path $Path)
{
$Key = Get-Item -LiteralPath $Path
if ($Key.GetValue($Name, $null) -ne $null)
{
if ($PassThru)
{
Get-ItemProperty $Path $Name
}
else
{
$true
}
}
else
{
$false
}
}
else
{
$false
}
}
}
Function Disable-UAC
{
$EnableUACRegistryPath = "REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System"
$EnableUACRegistryKeyName = "EnableLUA"
$UACKeyExists = Test-RegistryValue -RegistryPath $EnableUACRegistryPath -KeyName $EnableUACRegistryKeyName
if ($UACKeyExists)
{
Set-ItemProperty -Path $EnableUACRegistryPath -Name $EnableUACRegistryKeyName -Value 0
}
else
{
New-ItemProperty -Path $EnableUACRegistryPath -Name $EnableUACRegistryKeyName -Value 0 -PropertyType "DWord"
}
}
Nguồn
2012-03-05 19:00:00
Liệu khởi động lại đã xảy ra trong trật tự để thay đổi xảy ra? –
Nevermind chỉ trả lời câu hỏi của riêng tôi. –
Tôi đã thử nghiệm hành vi này thành công trên windows 10, nó cũng hoạt động trên các cửa sổ 7? Thật không may tôi đã không giành được 7 khách hàng cho thử nghiệm của riêng mình. Kính trọng Alexander –