Once installed, and everything else is completed.
Copy the content of the code box below.
Open Powershell as admin.
windows key and r at the same time.
Type powershell
Hit ok
Paste the content of the code box and hit enter.
Reboot the machine after, this will disable useless services.
Copy the content of the code box below.
Open Powershell as admin.
windows key and r at the same time.
Type powershell
Hit ok
Paste the content of the code box and hit enter.
Reboot the machine after, this will disable useless services.
Code:
# Elevate privileges if not already running as administrator if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { Start-Process powershell -Verb RunAs -ArgumentList @( '-NoProfile','-ExecutionPolicy','Bypass', '-File', "`"$PSCommandPath`"" ) exit } try { Checkpoint-Computer -Description 'PreBatchPCHF' -RestorePointType MODIFY_SETTINGS Write-Host 'Restore point created.' } catch { Write-Warning "Restore-point creation failed: $_" } Get-Service | Select Name,DisplayName,StartType | Export-Csv "$env:USERPROFILE\Desktop\Services-Before-$(Get-Date -f yyyyMMddHHmm).csv" ` -NoType Write-Host "Service state exported to Desktop." $servicesToDisable = @( "AppVClient","DiagTrack","BDESVC","Browser","DeviceAssociationService", "DialogBlockingService","DiagTrack","dmwappushservice","DmEnrollmentSvc", "EntAppSvc","Fax","HgClientService","HvHost","InventorySvc","lfsvc","MapsBroker", "NetTcpPortSharing","NgcCtnrSvc","NgcSvc","OneDrive","p2psvc","PhoneSvc", "PNRPsvc","PrintNotify","QWAVE","RasAuto","RasMan","RemoteRegistry","RetailDemo", "ssh-agent","SstpSvc","TabletInputService","vmicguestinterface","vmicheartbeat", "vmickvpexchange","vmicrdv","vmicshutdown","vmictimesync","vmicvmsession", "vmicvss","WalletService","WerSvc","WpcMonSvc","XblAuthManager","XblGameSave", "XboxNetApiSvc","AdobeARMservice","BITS","DoSvc","edgeupdate","edgeupdatem", "gupdate","gupdatem","HomeGroupListener","HomeGroupProvider", "MicrosoftEdgeUpdateService","PcaSvc","SharedAccess","SysMain","TrkWks", "UsoSvc","WerSvc","WMPNetworkSvc","WSearch","ClipSVC","TokenBroker", "WaaSMedicSvc","WaasPushService","PimIndexMaintenanceSvc","CaptureService", "PrintWorkflowUserSvc","XboxGipSvc","GamingServices","GamingServicesNet", "VacSvc","DbgSvc","MessagingService" ) | Sort-Object -Unique foreach ($svcName in $servicesToDisable) { if ($svc = Get-Service -Name $svcName -ErrorAction SilentlyContinue) { try { Stop-Service $svc -Force -ErrorAction Stop } catch { Write-Warning "Could not stop $svcName : $_" } try { Set-Service $svc -StartupType Disabled } catch { Write-Warning "Could not disable $svcName : $_" } Write-Host "Disabled: $svcName" } else { Write-Verbose "Service not found: $svcName" } } $tempFolders = @("C:\Windows\Temp\*","$env:TEMP\*") foreach ($path in $tempFolders) { try { Remove-Item $path -Recurse -Force -ErrorAction Stop } catch { Write-Warning "Couldn't remove some items in $path" } } Write-Host "Temp folders cleaned." Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power' ` -Name 'HiberbootEnabled' -Value 0 Write-Host "Fast Startup disabled." Write-Host "`nScript complete. Reboot when convenient."
Comment