1 - En PowerShell profiline (C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
)
2 Aşağıdaki iki işlevi ekleyin -
3 PowerShell
içinde
Disable-UAC
Run - değişikliklerin etkili olması için yeniden başlat. PowerShell kullanarak, bu
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"
}
}
yeniden başlatma gerçekleşmesi değişikliğin uygulanması için gerçekleşmesi var mı olurdu? –
Nevermind kendi sorumu yanıtladı. –
Bu davranışı Windows 10'da başarıyla test ettim, Windows 7'de de çalışıyor mu? Talihsizce kendi testi için 7 müşteri kazanamam. Saygılarımızla Alexander –