Created
April 9, 2021 14:47
-
-
Save scvnc/0cfb39c10bb92df235ffc7918729cbae to your computer and use it in GitHub Desktop.
Kill some background processes so that vanguard maybe doesnt kick me
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$processes = ( | |
"Dropbox*", | |
"DbxSvc.exe", | |
"EpicGamesLauncher.exe", | |
"boinc*", | |
"OneDrive.exe", | |
"mDNSResponder.exe", | |
"Lightshot.exe", | |
"MoUsoCoreWorker.exe", | |
"PnkBstrA.exe", | |
"YourPhone.exe", | |
"RuntimeBroker.exe", | |
"FAHClient.exe", | |
"EpocCamService.exe", | |
"GoogleCrashHandler*", | |
"mullvad-daemon.exe", | |
"OriginWebHelperService.exe" | |
); | |
# Hunk of code to make this script run as administrator | |
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) { | |
if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) { | |
$CommandLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments | |
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine | |
Exit | |
} | |
} | |
# Ask process to close, gently. | |
foreach ($p in $processes) { | |
taskkill /IM $p | |
} | |
# Kill each process if still remain. | |
foreach ($p in $processes) { | |
taskkill /F /IM $p | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment