Guest User

Untitled

a guest
Aug 16th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. .MSEInstall.exe /s /runwgacheck /o
  2. Start-Sleep 5 # I have no idea how to wait for the installer to finish
  3. Set-ItemProperty "HKLM:SOFTWAREMicrosoftMicrosoft AntimalwareScan"
  4. ScheduleDay "0"
  5.  
  6. Set-ItemProperty : Requested registry access is not allowed.
  7.  
  8. $user = whoami
  9. $regPath = "SOFTWAREMicrosoftMicrosoft AntimalwareScan"
  10. $key = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($regPath, [Microsoft.Win32.RegistryKeyPermissionCheck]::ReadWriteSubTree,[System.Security.AccessControl.RegistryRights]::ChangePermissions)
  11. $acl = $key.GetAccessControl()
  12. $rule = New-Object System.Security.AccessControl.RegistryAccessRule ($user,"FullControl","Allow")
  13. $acl.SetAccessRule($rule)
  14. $key.SetAccessControl($acl)
  15.  
  16. Exception calling "OpenSubKey" with "3" argument(s): "Requested registry access is not allowed.
Add Comment
Please, Sign In to add comment