Powershell. Импорт файла реестра с повышенными привелегиями
16 Feb 2021
local_offer
powershell
$startprocessParams = @{
FilePath = "$Env:SystemRoot\REGEDIT.exe"
ArgumentList = '/s', 'c:\temp\restore_windows_photoviewer.reg'
Verb = 'RunAs'
PassThru = $true
Wait = $true
}
$proc = Start-Process @startprocessParams
if ($proc.ExitCode -eq 0) {
'Success!'
}
else {
"Fail! Exit code: $($Proc.ExitCode)"
}