├── README.md
├── Script_1_to_get_list_of_services.ps1
└── Script_2_to_disable_bring_down_services.ps1
/README.md:
--------------------------------------------------------------------------------
1 | Windows Services Disabler
2 |
3 | Are you tired of your Windows operating system slowing down due to unnecessary services running in the background? Do you want to boost the performance of your system by disabling those services? Look no further! This script will help you to disable the services that are not required for your system to function properly.
4 |
5 | This script consists of two parts:
6 |
7 | Script 1:
8 | This script will generate a list of all the services currently running on your system in an Excel sheet. You can access this sheet on your desktop after running the script. This list will help you to identify the services that you want to disable.
9 |
10 | Script 2:
11 | This script will disable the services that you have specified. All you need to do is provide the list of services that you want to disable in the specified format. You can find an example in the script itself.
12 |
13 | To get started, follow these simple steps:
14 |
15 | Step 1: Open Windows PowerShell as an administrator. To do this, right-click on the start menu icon and select 'Windows PowerShell (Admin)'.
16 |
17 | Step 2: Copy and paste Script 1 into the PowerShell window and hit Enter. This will generate an Excel sheet with a list of all the services running on your system.
18 |
19 | Step 3: Identify the services that you want to disable from the generated list.
20 |
21 | Step 4: Copy and paste Script 2 into the PowerShell window, and provide the list of services that you want to disable in the specified format. You can find an example in the script itself.
22 |
23 | Step 5: Hit Enter, and let the script do its job.
24 |
25 | That's it! The services that you have specified will be disabled, and your system will run faster and smoother than ever before.
26 |
27 | Please note that disabling services that are required for your system to function properly can cause issues, so make sure that you know what you're doing before running the script. It is also recommended to create a backup of your system before running the script.
28 |
29 | We hope that this script will help you to optimize your system's performance and provide a better experience. Give it a try, and let us know your feedback!
30 |
--------------------------------------------------------------------------------
/Script_1_to_get_list_of_services.ps1:
--------------------------------------------------------------------------------
1 | # Run the below in Windows PowerShell (Admin) [ Right click on start menu icon and open this ]
2 | # An excel will be created in your desktop
3 | # Now get the service name list which you want to disable and change it into comma separated values with service names in double quotes
4 |
5 |
6 | Set-ExecutionPolicy RemoteSigned -Force
7 | Add-Type -AssemblyName System.Windows.Forms
8 | $desktopPath = [Environment]::GetFolderPath('Desktop')
9 | $services = Get-Service | Select-Object -Property Name, DisplayName, Description, Status, StartType
10 | $excel = New-Object -ComObject Excel.Application
11 | $workbook = $excel.Workbooks.Add()
12 | $worksheet = $workbook.Worksheets.Item(1)
13 | $worksheet.Name = "Services"
14 | $worksheet.Cells.Item(1,1) = "Service Name"
15 | $worksheet.Cells.Item(1,2) = "Display Name"
16 | $worksheet.Cells.Item(1,3) = "Description"
17 | $worksheet.Cells.Item(1,4) = "Status"
18 | $worksheet.Cells.Item(1,5) = "Startup Type"
19 | $row = 2
20 | foreach ($service in $services) {
21 | $worksheet.Cells.Item($row,1) = $service.Name
22 | $worksheet.Cells.Item($row,2) = $service.DisplayName
23 | $worksheet.Cells.Item($row,3) = $service.Description
24 | $worksheet.Cells.Item($row,4) = $service.Status
25 | $worksheet.Cells.Item($row,5) = $service.StartType
26 | $row++
27 | }
28 | $filename = [System.IO.Path]::Combine($desktopPath, "services_list.xlsx")
29 | $excel.DisplayAlerts = $false
30 | $workbook.SaveAs($filename)
31 | $workbook.Close()
32 | $excel.Quit()
33 | [System.Windows.Forms.MessageBox]::Show("The file has been generated and saved to your desktop.", "File Generated", [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Information)
34 | Set-ExecutionPolicy Restricted -Force
35 |
36 |
--------------------------------------------------------------------------------
/Script_2_to_disable_bring_down_services.ps1:
--------------------------------------------------------------------------------
1 | #Run the below in Windows PowerShell (Admin) [ Right click on start menu icon and open this ]
2 | #Provide the list in the below program to stop and disable the services
3 | #Example:
4 | #$services = @(
5 | #"SysMain",
6 | #"wscsvc",
7 | #"DiagTrack"
8 | #)
9 |
10 | Set-ExecutionPolicy RemoteSigned -Force
11 | $services = @(
12 | #the array of services which you want to disable, change it into comma separated values
13 | #with service names in double quotes and place it here
14 | )
15 |
16 | foreach ($serviceName in $services) {
17 | if ($serviceName.StartsWith("#")) {
18 | Write-Host "Ignoring commented service: $serviceName"
19 | continue
20 | }
21 |
22 | if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) {
23 | Write-Host "Service $serviceName exists. Disabling service..."
24 | REG ADD HKLM\SYSTEM\CurrentControlSet\Services\$serviceName /v Start /f /t REG_DWORD /d 4
25 | Stop-Service $serviceName -Force
26 | $process = Get-Process -Name $serviceName -ErrorAction SilentlyContinue
27 | if ($process) {
28 | Write-Host "Process with PID $($process.Id) exists. Killing process..."
29 | Stop-Process -Id $process.Id -Force
30 | }
31 | sc stop $serviceName
32 | } else {
33 | Write-Host "Service $serviceName does not exist."
34 | }
35 | }
36 | Set-ExecutionPolicy Restricted -Force
37 |
38 |
--------------------------------------------------------------------------------