-
-
Save iamjonny/cad47c59f6427be27d05d568b078edf4 to your computer and use it in GitHub Desktop.
Script to disable unnecesary Windows services and improve the performance.
This file contains hidden or 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
##################################################################################################################### | |
# Script to disable unnecesary Windows services and improve the performance. | |
# | |
# This use the command Set-Service, you can check the below link for more information | |
# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-service?view=powershell-7 | |
# | |
# You should check what service you want to disable, like Windows defender, Windows Search | |
# or Seclogon (necesary for some programs or games). | |
# Some services were removed in Windows 10. | |
##################################################################################################################### | |
$services = @( | |
"CertPropSvc" # Certificates Propagation Service | |
"diagnosticshub.standardcollector.service" # Microsoft (R) Diagnostics Hub Standard Collector Service | |
"DiagTrack" # Diagnostics Tracking Service | |
"DPS" # Diagnostic Policies Service | |
"dmwappushservice" # WAP Push Message Routing Service | |
# "HomeGroupListener" # HomeGroup Listener (Removed in Windows 10) | |
# "HomeGroupProvider" # HomeGroup Provider (Removed in Windows 10) | |
"iphlpsvc" # Auxiliar IP App | |
"lfsvc" # Geolocation Service | |
"lmhosts" # NetBIOS over TCP/IP Auxiliar App | |
"MapsBroker" # Downloaded Maps Manager | |
"MSiSCSI" # Microsoft iSCSI Initatior Service | |
"Netlogon" # NetLogon Service | |
"PcaSvc" # Compatibility Programs Assistant Service | |
"RemoteRegistry" # Remote Registry | |
"RemoteAccess" # Routing and Remote Access | |
"RpcLocator" # Remote Procedure Call (RPC) Locator | |
"SCardSvr" # Smart card | |
"SCPolicySvc" # Smart card Extraction Policy Service | |
# "seclogon" # Secundary Login Service | |
"SharedAccess" # Internet Connection Sharing (ICS) | |
"SNMPTRAP" # SNMP Capture Service | |
"Spooler" # Print Spooler Service | |
"stisvc" # Windows Image acquisition (WIA) Service | |
"TabletInputService" # Handwriting Panel and touch keyboard Service | |
"TrkWks" # Distributed Link Tracking Client | |
"WbioSrvc" # Windows Biometric Service | |
"WlanSvc" # WLAN AutoConfig | |
"WMPNetworkSvc" # Windows Media Player Network Sharing Service | |
# "wscsvc" # Windows Security Center Service | |
"WSearch" # Windows Search | |
) | |
foreach ($service in $services) { | |
echo "Trying to disable $service" | |
Get-Service -Name $service | Set-Service -StartupType Disabled | |
echo "$service disabled" | |
} |
What do you want to do?
Hello, I'm bad in computer. May I know how to run this script? Thanks
Here is how!
-
Open Powershell
- Press Win & X buttons on keyboard
- Then you will see the Terminal (Admin) or Powershell (Admin)
- Open it
-
Set the Execution Policy:
Run this command in an elevated PowerShell window (as Administrator):Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force
-
Drag and Drop the Script:
- Open the folder where your
disableServices.ps1
script is located (e.g., the Desktop). - Reopen Powershell as Administrator
- Drag the script file into the PowerShell window.
- This will automatically populate the full path of the script.
- Press Enter to execute the script.
- Open the folder where your
-
(For Security) Revert the Execution Policy:
It's a good security practice to revert the policy after the program:Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
Many thanks 😀
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to do that?