Advertisement
Guest User

test

a guest
Mar 22nd, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Set-RegistryKey -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" -Name "DisablePagingExecutive" -Value 1
  2.  
  3. ## delete hidden install files
  4. Get-ChildItem "%windir%\$NT*" -Recurse -Force -ErrorAction SilentlyContinue | remove-item -force -Verbose -recurse -ErrorAction SilentlyContinue
  5.  
  6. ## delete prefetch files
  7. Get-ChildItem "c:\Windows\Prefetch\*" -Recurse -Force -ErrorAction SilentlyContinue | remove-item -force -Verbose -recurse -ErrorAction SilentlyContinue
  8.  
  9. ### Size virtual machine RAM
  10. # Disable the automatic management of the paging filing size
  11. $ComputerSystem = gwmi Win32_ComputerSystem -EnableAllPrivileges
  12. $ComputerSystem.AutomaticManagedPagefile = $False
  13. $AutomaticManagedPagefile = $ComputerSystem.Put()
  14.  
  15. ## Clear all event logs
  16. wevtutil el | Foreach-Object {wevtutil cl "$_"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement