Guest User

CSGO-Cleaner V2.1

a guest
Oct 24th, 2014
3,150
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. $SteamActive=Get-Process steam.exe -ErrorAction SilentlyContinue
  27.  
  28.  
  29. #CLEANING
  30.  
  31. if ($SteamActive -eq $null) {Write-Host "Steam isn't launched, continue"}
  32. else {Write-Host "Killing Steam.exe Process"; Stop-Process -processname steam*}
  33. Start-Sleep -s 1
  34. Write-host "[OK]"
  35. Write-Host ""
  36. Write-Host Cleaning CSGO cache folder
  37. $csgocacheexist = Test-Path $csgocache
  38. If ($csgocacheexist -eq $True) {Remove-Item -Recurse -Force $csgocache | out-null; Write-Host "[OK]"; Write-Host ""}
  39. Else {Write-Host "[Error] Can't delete CSGO cache, folder not found !"; Write-Host ""}
  40. Write-Host Cleaning Steam cache folder
  41. $steamcacheexiste = Test-Path $steamcache
  42. If ($steamcacheexist -eq $True) {Remove-Item -Recurse -Force $steamcache | out-null; Write-Host "[OK]"; Write-Host ""}
  43. Else {Write-host "[Error] Can't delete Steam cache, folder not found !"; Write-Host ""}
  44. Write-host "Deleting blob file"
  45. $blobexist = Test-Path "$clientregistry"
  46. If ($blobexist -eq $True) {Remove-Item -Recurse -Force "$clientregistry" | out-null; Write-Host "[OK]"; Write-Host ""}
  47. Else {write-host "[Error] Can't delete clientregistry.blob, file not found !"; Write-Host ""}
  48. #Checking DEP
  49. #gwmi Win32_OperatingSystem | fl DataExecutionPrevention*
  50. Write-Host Enabling Data Execution Prevention
  51. "$bcdedit /set {current} nx AlwaysOn" | out-null
  52. Write-host "[OK]"
  53. Write-Host ""
  54. Write-Host "Repairing SteamService"
  55. "$steamservice /repair" | out-null
  56. Write-host "[OK]"
  57. Write-Host ""
  58. Write-Host "Enabling Kernel Integrity"
  59. "$bcdedit.exe /deletevalue nointegritychecks" | out-null
  60. "$bcdedit.exe /deletevalue loadoptions" | out-null
  61. Write-Host "[OK]"
  62. Write-Host ""
  63. Write-Host "Disabling Kernel Debug"
  64. "$bcdedit.exe /debug off" | out-null
  65. Write-Host "[OK]"
  66. Write-Host ""
  67. Write-Host "Disabling UAC"
  68. #&"cmd.exe" $UACArgs
  69. New-ItemProperty -Path HKLM:Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -PropertyType DWord -Value 0 -Force | out-null
  70. Start-Sleep -s 1
  71. Write-Host ""
  72. Write-host "CSGO-Cleaner job is finished. You can now launch Steam"
  73. Write-Host ""
  74. Write-Host "Can i do more than this script ?"
  75. Write-host "Yeah there is some things that can not be added in the script and you are able to dot by yourself"
  76. Write-Host ""
  77. Write-Host "1. Change your steam shortcut to add 'tcp' and 'clearbeta' parameters ('...\Steam\steam.exe' -tcp -clearbeta)"
  78. Write-Host "2. Verify Integrty of CS:GO game cache"
  79. Write-Host "3. Disable your AntiVirus"
  80. Write-Host 'Press any key to continue...';
  81. $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');
Advertisement
Add Comment
Please, Sign In to add comment