Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Write-Host
- Write-Host
- Write-Host "+---------------------------------------+"
- Write-Host "| Steam/CSGO Cleaner |"
- Write-Host "|---------------------------------------|"
- Write-Host "| |"
- Write-Host "| last update by JFF 10/24/2014 |"
- Write-Host "+---------------------------------------+"
- Write-Host
- Write-Host
- #VARS
- $steaminstall=Read-Host "Steam installation folder (Default : C:\Program Files (x86)\Steam)"
- if($steaminstall -eq "") {$steaminstall="C:\Program Files (x86)\Steam"}
- $steaminstall=$steaminstall.Trimend('\')
- $SteamService="$steaminstall\bin\SteamService.exe"
- $steamservice=$steamservice.Trimend('\')
- $csgofolder=Read-Host "CSGO Installation Folder starting with 'SteamApps' (leave blank if default)"
- $csgofolder=$csgofolder.Trimend('\')
- if($csgofolder -eq "") {$csgofolder="$steaminstall\SteamApps\common\Counter-Strike Global Offensive\csgo"}
- $csgocache="$csgofolder\cache\"
- $steamcache="$steaminstall\appcache\"
- $clientregistry = "$steaminstall\clientregistry.blob"
- $bcdedit = "%windir%\system32\bcdedit"
- $UACArgs = @("/k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f")
- #CLEANING
- Write-Host Killing Steam.exe Process
- Stop-Process -processname steam*
- Start-Sleep -s 1
- Write-host "[OK]"
- Write-Host ""
- Write-Host Cleaning CSGO cache folder
- $csgocacheexist = Test-Path $csgocache
- If ($csgocacheexist -eq $True) {Remove-Item -Recurse -Force $csgocache | out-null; Write-Host "[OK]"; Write-Host ""}
- Else {Write-Host "[Error] Can't delete CSGO cache, folder not found !"; Write-Host ""}
- Write-Host Cleaning Steam cache folder
- $steamcacheexiste = Test-Path $steamcache
- If ($steamcacheexist -eq $True) {Remove-Item -Recurse -Force $steamcache | out-null; Write-Host "[OK]"; Write-Host ""}
- Else {Write-host "[Error] Can't delete Steam cache, folder not found !"; Write-Host ""}
- Write-host "Deleting blob file"
- $blobexist = Test-Path "$clientregistry"
- If ($blobexist -eq $True) {Remove-Item -Recurse -Force "$clientregistry" | out-null; Write-Host "[OK]"; Write-Host ""}
- Else {write-host "[Error] Can't delete clientregistry.blob, file not found !"; Write-Host ""}
- #Checking DEP
- #gwmi Win32_OperatingSystem | fl DataExecutionPrevention*
- Write-Host Enabling Data Execution Prevention
- "$bcdedit /set {current} nx AlwaysOn" | out-null
- Write-host "[OK]"
- Write-Host ""
- Write-Host "Repairing SteamService"
- "$steamservice /repair" | out-null
- Write-host "[OK]"
- Write-Host ""
- Write-Host "Enabling Kernel Integrity"
- "$bcdedit.exe /deletevalue nointegritychecks" | out-null
- "$bcdedit.exe /deletevalue loadoptions" | out-null
- Write-Host "[OK]"
- Write-Host ""
- Write-Host "Disabling Kernel Debug"
- "$bcdedit.exe /debug off" | out-null
- Write-Host "[OK]"
- Write-Host ""
- Write-Host "Disabling UAC"
- #&"cmd.exe" $UACArgs
- New-ItemProperty -Path HKLM:Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -PropertyType DWord -Value 0 -Force | out-null
- Start-Sleep -s 1
- Write-Host ""
- Write-host "CSGO-Cleaner job is finished. You can now launch Steam"
- Write-Host ""
- Write-Host "Can i do more than this script ?"
- Write-host "Yeah there is some things that can not be added in the script and you are able to dot by yourself"
- Write-Host ""
- Write-Host "1. Change your steam shortcut to add 'tcp' and 'clearbeta' parameters ('...\Steam\steam.exe' -tcp -clearbeta)"
- Write-Host "2. Verify Integrty of CS:GO game cache"
- Write-Host "3. Disable your AntiVirus"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement