Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $taskmgrPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager'
  2. If (!(Test-Path $taskmgrPath))
  3. {
  4.     New-Item -Path $taskmgrPath -Force
  5. }
  6. $taskmgr = Get-Process Taskmgr -ErrorAction SilentlyContinue
  7. If ($taskmgr)
  8. {
  9.     #$taskmgr | Stop-Process -Force
  10.     $taskmgr | Wait-Process
  11. }
  12. $preferences = Get-ItemProperty -Path $taskmgrPath -Name Preferences -ErrorAction SilentlyContinue
  13. If (!($preferences))
  14. {
  15.     Start-Process -FilePath Taskmgr
  16.     $taskmgr = Get-Process Taskmgr -ErrorAction SilentlyContinue
  17.     If ($taskmgr)
  18.     {
  19.        #$taskmgr | Stop-Process -Force
  20.        $taskmgr | Wait-Process
  21.     }
  22.     $preferences = Get-ItemProperty -Path $taskmgrPath -Name Preferences -ErrorAction SilentlyContinue
  23. }
  24. $preferences.Preferences[28] = 0
  25. New-ItemProperty -Path $taskmgrPath -Name Preferences -Type Binary -Value $preferences.Preferences -Force
  26. If ($taskmgr)
  27. {
  28.    $taskmgr | Stop-Process -Force
  29. }
  30. Start-Process -FilePath Taskmgr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement