Advertisement
Guest User

CSGO-Cleaner v2

a guest
Oct 24th, 2014
3,155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Write-Host
  2. Write-Host
  3. Write-Host "+---------------------------------------+"
  4. Write-Host "|          Steam/CSGO Cleaner           |"
  5. Write-Host "|---------------------------------------|"
  6. Write-Host "|                                       |"
  7. Write-Host "|    last update by JFF  10/24/2014     |"
  8. Write-Host "+---------------------------------------+"
  9. Write-Host
  10. Write-Host
  11.  
  12. #VARS
  13. $steaminstall=Read-Host "Steam installation folder (Default : C:\Program Files (x86)\Steam)"
  14. if($steaminstall -eq "") {$steaminstall="C:\Program Files (x86)\Steam"}
  15. $steaminstall=$steaminstall.Trimend('\')
  16. $SteamService="$steaminstall\bin\SteamService.exe"
  17. $steamservice=$steamservice.Trimend('\')
  18. $csgofolder=Read-Host "CSGO Installation Folder starting with 'SteamApps' (leave blank if default)"
  19. $csgofolder=$csgofolder.Trimend('\')
  20. if($csgofolder -eq "") {$csgofolder="$steaminstall\SteamApps\common\Counter-Strike Global Offensive\csgo"}
  21. $csgocache="$csgofolder\cache\"
  22. $steamcache="$steaminstall\appcache\"
  23. $clientregistry = "$steaminstall\clientregistry.blob"
  24. $bcdedit = "%windir%\system32\bcdedit"
  25. $UACArgs = @("/k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f")
  26.  
  27.  
  28.  
  29. #CLEANING
  30. Write-Host Killing Steam.exe Process
  31. Stop-Process -processname steam*
  32. Start-Sleep -s 1
  33. Write-host "[OK]"
  34. Write-Host ""
  35. Write-Host Cleaning CSGO cache folder
  36. $csgocacheexist = Test-Path $csgocache
  37. If ($csgocacheexist -eq $True) {Remove-Item -Recurse -Force $csgocache | out-null; Write-Host "[OK]"; Write-Host ""}
  38. Else {Write-Host "[Error] Can't delete CSGO cache, folder not found !"; Write-Host ""}
  39. Write-Host Cleaning Steam cache folder
  40. $steamcacheexiste = Test-Path $steamcache
  41. If ($steamcacheexist -eq $True) {Remove-Item -Recurse -Force $steamcache | out-null; Write-Host "[OK]"; Write-Host ""}
  42. Else {Write-host "[Error] Can't delete Steam cache, folder not found !"; Write-Host ""}
  43. Write-host "Deleting blob file"
  44. $blobexist = Test-Path "$clientregistry"
  45. If ($blobexist -eq $True) {Remove-Item -Recurse -Force "$clientregistry" | out-null; Write-Host "[OK]"; Write-Host ""}
  46. Else {write-host "[Error] Can't delete clientregistry.blob, file not found !"; Write-Host ""}
  47. #Checking DEP
  48. #gwmi Win32_OperatingSystem | fl DataExecutionPrevention*
  49. Write-Host Enabling Data Execution Prevention
  50. "$bcdedit /set {current} nx AlwaysOn" | out-null
  51. Write-host "[OK]"
  52. Write-Host ""
  53. Write-Host "Repairing SteamService"
  54. "$steamservice /repair" | out-null
  55. Write-host "[OK]"
  56. Write-Host ""
  57. Write-Host "Enabling Kernel Integrity"
  58. "$bcdedit.exe /deletevalue nointegritychecks" | out-null
  59. "$bcdedit.exe /deletevalue loadoptions" | out-null
  60. Write-Host "[OK]"
  61. Write-Host ""
  62. Write-Host "Disabling Kernel Debug"
  63. "$bcdedit.exe /debug off" | out-null
  64. Write-Host "[OK]"
  65. Write-Host ""
  66. Write-Host "Disabling UAC"
  67. #&"cmd.exe" $UACArgs
  68. New-ItemProperty -Path HKLM:Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -PropertyType DWord -Value 0 -Force | out-null
  69. Start-Sleep -s 1
  70. Write-Host ""
  71. Write-host "CSGO-Cleaner job is finished. You can now launch Steam"
  72. Write-Host ""
  73. Write-Host "Can i do more than this script ?"
  74. Write-host "Yeah there is some things that can not be added in the script and you are able to dot by yourself"
  75. Write-Host ""
  76. Write-Host "1. Change your steam shortcut to add 'tcp' and 'clearbeta' parameters ('...\Steam\steam.exe' -tcp -clearbeta)"
  77. Write-Host "2. Verify Integrty of CS:GO game cache"
  78. Write-Host "3. Disable your AntiVirus"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement