Reducir Procesos Innecesarios de Windows
Reducir Procesos Innecesarios de Windows
$BranchToUse = 'main'
<#
.NOTES
Author : Chris Titus @christitustech
GitHub : https://github.com/ChrisTitusTech
Version 0.0.1
#>
(
"applications",
"tweaks",
"preset",
"feature"
) | ForEach-Object {
#$configs["$PSItem"] = Get-Content .\config\$PSItem.json | ConvertFrom-Json
$configs["$psitem"] = Invoke-RestMethod
"https://raw.githubusercontent.com/ChrisTitusTech/winutil/$BranchToUse/config/
$psitem.json"
}
#===========================================================================
# Store Form Objects In PowerShell
#===========================================================================
#===========================================================================
# Functions
#===========================================================================
Function Get-FormVariables {
#If ($global:ReadmeDisplay -ne $true) { Write-host "If you need to reference
this display again, run Get-FormVariables" -ForegroundColor Yellow;
$global:ReadmeDisplay = $true }
write-host ""
write-host " CCCCCCCCCCCCCTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT "
write-host " CCC::::::::::::CT:::::::::::::::::::::TT:::::::::::::::::::::T "
write-host "CC:::::::::::::::CT:::::::::::::::::::::TT:::::::::::::::::::::T "
write-host "C:::::CCCCCCCC::::CT:::::TT:::::::TT:::::TT:::::TT:::::::TT:::::T "
write-host "C:::::C CCCCCCTTTTTT T:::::T TTTTTTTTTTTT T:::::T TTTTTT"
write-host "C:::::C T:::::T T:::::T "
write-host "C:::::C T:::::T T:::::T "
write-host "C:::::C T:::::T T:::::T "
write-host "C:::::C T:::::T T:::::T "
write-host "C:::::C T:::::T T:::::T "
write-host "C:::::C T:::::T T:::::T "
write-host "C:::::C CCCCCC T:::::T T:::::T "
write-host "C:::::CCCCCCCC::::C TT:::::::TT TT:::::::TT "
write-host "CC:::::::::::::::C T:::::::::T T:::::::::T "
write-host "CCC::::::::::::C T:::::::::T T:::::::::T "
write-host " CCCCCCCCCCCCC TTTTTTTTTTT TTTTTTTTTTT "
write-host ""
write-host "====Chris Titus Tech====="
write-host "=====Windows Toolbox====="
Function Get-CheckBoxes {
<#
.DESCRIPTION
Function is meant to find all checkboxes that are checked on the specefic
tab and input them into a script.
Outputed data will be the names of the checkboxes that were checked
.EXAMPLE
Get-CheckBoxes "WPFInstall"
#>
Param($Group)
$CheckBox.value.ischecked = $false
}
}
}
function Set-Presets {
<#
.DESCRIPTION
Meant to make settings presets easier in the tweaks tab. Will pull the data
from config/preset.json
#>
param($preset)
$CheckBoxesToCheck = $configs.preset.$preset
#Uncheck all
get-variable | Where-Object {$_.name -like "*tweaks*"} | ForEach-Object {
if ($psitem.value.gettype().name -eq "CheckBox"){
$CheckBox = Get-Variable $psitem.Name
if ($CheckBoxesToCheck -contains $CheckBox.name){
$checkbox.value.ischecked = $true
}
else{$checkbox.value.ischecked = $false}
}
}
}
#===========================================================================
# Global Variables
#===========================================================================
#===========================================================================
# Navigation Controls
#===========================================================================
$WPFTab1BT.Add_Click({
$WPFTabNav.Items[0].IsSelected = $true
$WPFTabNav.Items[1].IsSelected = $false
$WPFTabNav.Items[2].IsSelected = $false
$WPFTabNav.Items[3].IsSelected = $false
})
$WPFTab2BT.Add_Click({
$WPFTabNav.Items[0].IsSelected = $false
$WPFTabNav.Items[1].IsSelected = $true
$WPFTabNav.Items[2].IsSelected = $false
$WPFTabNav.Items[3].IsSelected = $false
})
$WPFTab3BT.Add_Click({
$WPFTabNav.Items[0].IsSelected = $false
$WPFTabNav.Items[1].IsSelected = $false
$WPFTabNav.Items[2].IsSelected = $true
$WPFTabNav.Items[3].IsSelected = $false
})
$WPFTab4BT.Add_Click({
$WPFTabNav.Items[0].IsSelected = $false
$WPFTabNav.Items[1].IsSelected = $false
$WPFTabNav.Items[2].IsSelected = $false
$WPFTabNav.Items[3].IsSelected = $true
})
#===========================================================================
# Tab 1 - Install
#===========================================================================
$WPFinstall.Add_Click({
$WingetInstall = Get-CheckBoxes -Group "WPFInstall"
}
elseif (((Get-ComputerInfo).WindowsVersion) -lt "1809") {
#Checks if Windows Version is too old for winget
Write-Host "Winget is not supported on this version of Windows
(Pre-1809)"
}
else {
#Installing Winget from the Microsoft Store
Write-Host "Winget not found, installing it now."
Start-Process "ms-appinstaller:?source=https://aka.ms/getwinget"
$nid = (Get-Process AppInstaller).Id
Wait-Process -Id $nid
Write-Host "Winget Installed"
}
}
if ($wingetinstall.Count -eq 0) {
$WarningMsg = "Please select the program(s) to install"
[System.Windows.MessageBox]::Show($WarningMsg, $AppTitle,
[System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
return
}
Write-Host "================================="
Write-Host "--- Installs are Finished ---"
Write-Host "================================="
})
$WPFInstallUpgrade.Add_Click({
$isUpgradeSuccess = $false
try {
Start-Process powershell.exe -Verb RunAs -ArgumentList "-command winget
upgrade --all | Out-Host" -Wait -WindowStyle Normal
$isUpgradeSuccess = $true
}
catch [System.InvalidOperationException] {
Write-Warning "Allow Yes on User Access Control to Upgrade"
}
catch {
Write-Error $_.Exception
}
$ButtonType = [System.Windows.MessageBoxButton]::OK
$Messageboxbody = if ($isUpgradeSuccess) { "Upgrade Done" } else { "Upgrade
was not succesful" }
$MessageIcon = [System.Windows.MessageBoxImage]::Information
#===========================================================================
# Tab 2 - Tweak Buttons
#===========================================================================
$WPFdesktop.Add_Click({
Set-Presets "Desktop"
})
$WPFlaptop.Add_Click({
Set-Presets "laptop"
})
$WPFminimal.Add_Click({
Set-Presets "minimal"
})
$WPFtweaksbutton.Add_Click({
$services = @(
"ALG" # Application Layer
Gateway Service(Provides support for 3rd party protocol plug-ins for Internet
Connection Sharing)
"AJRouter" # Needed for AllJoyn
Router Service
"BcastDVRUserService_48486de" # GameDVR and
Broadcast is used for Game Recordings and Live Broadcasts
#"BDESVC" # Bitlocker Drive
Encryption Service
#"BFE" # Base Filtering
Engine (Manages Firewall and Internet Protocol security)
#"BluetoothUserService_48486de" # Bluetooth user
service supports proper functionality of Bluetooth features relevant to each user
session.
#"BrokerInfrastructure" # Windows
Infrastructure Service (Controls which background tasks can run on the system)
"Browser" # Let users browse
and locate shared resources in neighboring computers
"BthAvctpSvc" # AVCTP service
(needed for Bluetooth Audio Devices or Wireless Headphones)
"CaptureService_48486de" # Optional screen
capture functionality for applications that call the Windows.Graphics.Capture API.
"cbdhsvc_48486de" # Clipboard Service
"diagnosticshub.standardcollector.service" # Microsoft (R)
Diagnostics Hub Standard Collector Service
"DiagTrack" # Diagnostics
Tracking Service
"dmwappushservice" # WAP Push Message
Routing Service
"DPS" # Diagnostic Policy
Service (Detects and Troubleshoots Potential Problems)
"edgeupdate" # Edge Update
Service
"edgeupdatem" # Another Update
Service
#"EntAppSvc" # Enterprise
Application Management.
"Fax" # Fax Service
"fhsvc" # Fax History
"FontCache" # Windows font cache
#"FrameServer" # Windows Camera
Frame Server (Allows multiple clients to access video frames from camera devices)
"gupdate" # Google Update
"gupdatem" # Another Google
Update Service
#"iphlpsvc" # ipv6(Most
websites use ipv4 instead) - Needed for Xbox Live
"lfsvc" # Geolocation
Service
#"LicenseManager" # Disable
LicenseManager (Windows Store may not work properly)
"lmhosts" # TCP/IP NetBIOS
Helper
"MapsBroker" # Downloaded Maps
Manager
"MicrosoftEdgeElevationService" # Another Edge
Update Service
"MSDTC" # Distributed
Transaction Coordinator
"NahimicService" # Nahimic Service
#"ndu" # Windows Network
Data Usage Monitor (Disabling Breaks Task Manager Per-Process Network Monitoring)
"NetTcpPortSharing" # Net.Tcp Port
Sharing Service
"PcaSvc" # Program
Compatibility Assistant Service
"PerfHost" # Remote users and
64-bit processes to query performance.
"PhoneSvc" # Phone
Service(Manages the telephony state on the device)
#"PNRPsvc" # Peer Name
Resolution Protocol (Some peer-to-peer and collaborative applications, such as
Remote Assistance, may not function, Discord will still work)
#"p2psvc" # Peer Name
Resolution Protocol(Enables multi-party communication using Peer-to-Peer Grouping.
If disabled, some applications, such as HomeGroup, may not function. Discord will
still work)iscord will still work)
#"p2pimsvc" # Peer Networking
Identity Manager (Peer-to-Peer Grouping services may not function, and some
applications, such as HomeGroup and Remote Assistance, may not function correctly.
Discord will still work)
"PrintNotify" # Windows printer
notifications and extentions
"QWAVE" # Quality Windows
Audio Video Experience (audio and video might sound worse)
"RemoteAccess" # Routing and Remote
Access
"RemoteRegistry" # Remote Registry
"RetailDemo" # Demo Mode for
Store Display
"RtkBtManServ" # Realtek Bluetooth
Device Manager Service
"SCardSvr" # Windows Smart Card
Service
"seclogon" # Secondary Logon
(Disables other credentials only password will work)
"SEMgrSvc" # Payments and
NFC/SE Manager (Manages payments and Near Field Communication (NFC) based secure
elements)
"SharedAccess" # Internet
Connection Sharing (ICS)
#"Spooler" # Printing
"stisvc" # Windows Image
Acquisition (WIA)
#"StorSvc" # StorSvc (usb
external hard drive will not be reconized by windows)
"SysMain" # Analyses System
Usage and Improves Performance
"TrkWks" # Distributed Link
Tracking Client
#"WbioSrvc" # Windows Biometric
Service (required for Fingerprint reader / facial detection)
"WerSvc" # Windows error
reporting
"wisvc" # Windows Insider
program(Windows Insider will not work if Disabled)
#"WlanSvc" # WLAN AutoConfig
"WMPNetworkSvc" # Windows Media
Player Network Sharing Service
"WpcMonSvc" # Parental Controls
"WPDBusEnum" # Portable Device
Enumerator Service
"WpnService" # WpnService (Push
Notifications may not work)
#"wscsvc" # Windows Security
Center Service
"WSearch" # Windows Search
"XblAuthManager" # Xbox Live Auth
Manager (Disabling Breaks Xbox Live Games)
"XblGameSave" # Xbox Live Game
Save Service (Disabling Breaks Xbox Live Games)
"XboxNetApiSvc" # Xbox Live
Networking Service (Disabling Breaks Xbox Live Games)
"XboxGipSvc" # Xbox Accessory
Management Service
# Hp services
"HPAppHelperCap"
"HPDiagsCap"
"HPNetworkCap"
"HPSysInfoCap"
"HpTouchpointAnalyticsService"
# Hyper-V services
"HvHost"
"vmicguestinterface"
"vmicheartbeat"
"vmickvpexchange"
"vmicrdv"
"vmicshutdown"
"vmictimesync"
"vmicvmsession"
# Services that cannot be disabled
#"WdNisSvc"
)
foreach ($service in $services) {
# -ErrorAction SilentlyContinue is so it doesn't write an error to
stdout if a service doesn't exist
# Network Tweaks
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\
LanmanServer\Parameters" -Name "IRPStackSize" -Type DWord -Value 20
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\
CurrentVersion\Multimedia\SystemProfile" -Name "NetworkThrottlingIndex" -Type DWord
-Value 4294967295
# Gaming Tweaks
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\
CurrentVersion\Multimedia\SystemProfile\Tasks\Games" -Name "GPU Priority" -Type
DWord -Value 8
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\
CurrentVersion\Multimedia\SystemProfile\Tasks\Games" -Name "Priority" -Type DWord -
Value 6
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\
CurrentVersion\Multimedia\SystemProfile\Tasks\Games" -Name "Scheduling Category" -
Type String -Value "High"
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\
Policies\Explorer")) {
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\
Policies\Explorer" -Force | Out-Null
}
$WPFEssTweaksTele.IsChecked = $false
}
If ( $WPFEssTweaksWifi.IsChecked -eq $true ) {
Write-Host "Disabling Wi-Fi Sense..."
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\
AllowWiFiHotSpotReporting")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\
WiFi\AllowWiFiHotSpotReporting" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\
WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\
AllowAutoConnectToWiFiSenseHotspots")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\
WiFi\AllowAutoConnectToWiFiSenseHotspots" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\
WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 0
$WPFEssTweaksWifi.IsChecked = $false
}
If ( $WPFMiscTweaksLapPower.IsChecked -eq $true ) {
If (Test-Path "HKLM:\SYSTEM\CurrentControlSet\Control\Power\
PowerThrottling") {
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\
Power\PowerThrottling" -Name "PowerThrottlingOff" -Type DWord -Value 00000000
}
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session
Manager\Power" -Name "HiberbootEnabled" -Type DWord -Value 0000001
$WPFMiscTweaksLapPower.IsChecked = $false
}
If ( $WPFMiscTweaksLapNum.IsChecked -eq $true ) {
Write-Host "Disabling NumLock after startup..."
If (!(Test-Path "HKU:")) {
New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-
Null
}
Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name
"InitialKeyboardIndicators" -Type DWord -Value 0
$WPFMiscTweaksLapNum.IsChecked = $false
}
If ( $WPFMiscTweaksPower.IsChecked -eq $true ) {
If (Test-Path "HKLM:\SYSTEM\CurrentControlSet\Control\Power\
PowerThrottling") {
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\
Power\PowerThrottling" -Name "PowerThrottlingOff" -Type DWord -Value 00000001
}
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session
Manager\Power" -Name "HiberbootEnabled" -Type DWord -Value 0000000
$WPFMiscTweaksPower.IsChecked = $false
}
If ( $WPFMiscTweaksNum.IsChecked -eq $true ) {
Write-Host "Enabling NumLock after startup..."
If (!(Test-Path "HKU:")) {
New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-
Null
}
Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name
"InitialKeyboardIndicators" -Type DWord -Value 2
$WPFMiscTweaksNum.IsChecked = $false
}
If ( $WPFMiscTweaksExt.IsChecked -eq $true ) {
Write-Host "Showing known file extensions..."
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\
CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 0
$WPFMiscTweaksExt.IsChecked = $false
}
If ( $WPFMiscTweaksUTC.IsChecked -eq $true ) {
Write-Host "Setting BIOS time to UTC..."
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\
TimeZoneInformation" -Name "RealTimeIsUniversal" -Type DWord -Value 1
$WPFMiscTweaksUTC.IsChecked = $false
}
If ( $WPFMiscTweaksDisplay.IsChecked -eq $true ) {
Write-Host "Adjusting visual effects for performance..."
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name
"DragFullWindows" -Type String -Value 0
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name
"MenuShowDelay" -Type String -Value 200
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name
"UserPreferencesMask" -Type Binary -Value ([byte[]](144, 18, 3, 128, 16, 0, 0, 0))
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop\WindowMetrics" -
Name "MinAnimate" -Type String -Value 0
Set-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name
"KeyboardDelay" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\
CurrentVersion\Explorer\Advanced" -Name "ListviewAlphaSelect" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\
CurrentVersion\Explorer\Advanced" -Name "ListviewShadow" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\
CurrentVersion\Explorer\Advanced" -Name "TaskbarAnimations" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\
CurrentVersion\Explorer\VisualEffects" -Name "VisualFXSetting" -Type DWord -Value 3
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name
"EnableAeroPeek" -Type DWord -Value 0
Write-Host "Adjusted visual effects for performance"
$WPFMiscTweaksDisplay.IsChecked = $false
}
If ( $WPFMiscTweaksDisableMouseAcceleration.IsChecked -eq $true ) {
Write-Host "Disabling mouse acceleration..."
Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSpeed" -
Type String -Value 0
Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name
"MouseThreshold1" -Type String -Value 0
Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name
"MouseThreshold2" -Type String -Value 0
$WPFMiscTweaksDisableMouseAcceleration.IsChecked = $false
}
If ( $WPFMiscTweaksEnableMouseAcceleration.IsChecked -eq $true ) {
Write-Host "Enabling mouse acceleration..."
Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSpeed" -
Type String -Value 1
Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name
"MouseThreshold1" -Type String -Value 6
Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name
"MouseThreshold2" -Type String -Value 10
$WPFMiscTweaksEnableMouseAcceleration.IsChecked = $false
}
If ( $WPFEssTweaksRemoveCortana.IsChecked -eq $true ) {
Write-Host "Removing Cortana..."
Get-AppxPackage -allusers Microsoft.549981C3F5F10 | Remove-AppxPackage
$WPFEssTweaksRemoveCortana.IsChecked = $false
}
If ( $WPFEssTweaksRemoveEdge.IsChecked -eq $true ) {
Write-Host "Removing Microsoft Edge..."
Invoke-WebRequest -useb
https://raw.githubusercontent.com/ChrisTitusTech/winutil/$BranchToUse/
Edge_Removal.bat | Invoke-Expression
$WPFEssTweaksRemoveEdge.IsChecked = $false
}
If ( $WPFEssTweaksDeBloat.IsChecked -eq $true ) {
$Bloatware = @(
#Unnecessary Windows 10 AppX Apps
"3DBuilder"
"Microsoft3DViewer"
"AppConnector"
"BingFinance"
"BingNews"
"BingSports"
"BingTranslator"
"BingWeather"
"BingFoodAndDrink"
"BingHealthAndFitness"
"BingTravel"
"MinecraftUWP"
"GamingServices"
# "WindowsReadingList"
"GetHelp"
"Getstarted"
"Messaging"
"Microsoft3DViewer"
"MicrosoftSolitaireCollection"
"NetworkSpeedTest"
"News"
"Lens"
"Sway"
"OneNote"
"OneConnect"
"People"
"Print3D"
"SkypeApp"
"Todos"
"Wallet"
"Whiteboard"
"WindowsAlarms"
"windowscommunicationsapps"
"WindowsFeedbackHub"
"WindowsMaps"
"WindowsPhone"
"WindowsSoundRecorder"
"XboxApp"
"ConnectivityStore"
"CommsPhone"
"ScreenSketch"
"TCUI"
"XboxGameOverlay"
"XboxGameCallableUI"
"XboxSpeechToTextOverlay"
"MixedReality.Portal"
"ZuneMusic"
"ZuneVideo"
#"YourPhone"
"Getstarted"
"MicrosoftOfficeHub"
# HPBloatware Packages
"HPJumpStarts"
"HPPCHardwareDiagnosticsWindows"
"HPPowerManager"
"HPPrivacySettings"
"HPSupportAssistant"
"HPSureShieldAI"
"HPSystemInformation"
"HPQuickDrop"
"HPWorkWell"
"myHP"
"HPDesktopSupportUtilities"
"HPQuickTouch"
"HPEasyClean"
"HPSystemInformation"
)
Try {
$Null = $_ | Uninstall-Package -AllVersions -Force -ErrorAction
SilentlyContinue
Write-Host -Object "Successfully uninstalled: [$($_.Name)]"
}
Catch {
Write-Warning -Message "Failed to uninstall: [$($_.Name)]"
}
}
Write-Host "Finished Removing Bloatware Programs"
$WPFEssTweaksDeBloat.IsChecked = $false
}
Write-Host "================================="
Write-Host "-- Tweaks are Finished ---"
Write-Host "================================="
$ButtonType = [System.Windows.MessageBoxButton]::OK
$MessageboxTitle = "Tweaks are Finished "
$Messageboxbody = ("Done")
$MessageIcon = [System.Windows.MessageBoxImage]::Information
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle,
$ButtonType, $MessageIcon)
})
$WPFAddUltPerf.Add_Click({
Write-Host "Adding Ultimate Performance Profile"
powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61
Write-Host "Profile added"
}
)
$WPFRemoveUltPerf.Add_Click({
Write-Host "Removing Ultimate Performance Profile"
powercfg -delete e9a42b02-d5df-448d-aa00-03f14749eb61
Write-Host "Profile Removed"
}
)
function Get-AppsUseLightTheme{
return (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\
CurrentVersion\Themes\Personalize').AppsUseLightTheme
}
function Get-SystemUsesLightTheme{
return (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\
CurrentVersion\Themes\Personalize').SystemUsesLightTheme
}
$WPFToggleDarkMode.Add_Click({
$EnableDarkMode = $WPFToggleDarkMode.IsChecked
$DarkMoveValue = $(If ( $EnableDarkMode ) {0} Else {1})
Write-Host $(If ( $EnableDarkMode ) {"Enabling Dark Mode"} Else {"Disabling
Dark Mode"})
$Theme = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
If ($DarkMoveValue -ne $(Get-AppsUseLightTheme))
{
Set-ItemProperty $Theme AppsUseLightTheme -Value $DarkMoveValue
}
If ($DarkMoveValue -ne $(Get-SystemUsesLightTheme))
{
Set-ItemProperty $Theme SystemUsesLightTheme -Value $DarkMoveValue
}
Write-Host $(If ( $EnableDarkMode ) {"Enabled"} Else {"Disabled"})
}
)
#===========================================================================
# Undo All
#===========================================================================
$WPFundoall.Add_Click({
Write-Host "Creating Restore Point in case something bad happens"
Enable-ComputerRestore -Drive "$env:SystemDrive"
Checkpoint-Computer -Description "RestorePoint1" -RestorePointType
"MODIFY_SETTINGS"
$ButtonType = [System.Windows.MessageBoxButton]::OK
$MessageboxTitle = "Undo All"
$Messageboxbody = ("Done")
$MessageIcon = [System.Windows.MessageBoxImage]::Information
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle,
$ButtonType, $MessageIcon)
Write-Host "================================="
Write-Host "--- Undo All is Finished ---"
Write-Host "================================="
})
#===========================================================================
# Tab 3 - Config Buttons
#===========================================================================
$WPFFeatureInstall.Add_Click({
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle,
$ButtonType, $MessageIcon)
Write-Host "================================="
Write-Host "--- Features are Installed ---"
Write-Host "================================="
})
$WPFPanelDISM.Add_Click({
Start-Process PowerShell -ArgumentList "Write-Host '(1/4) Chkdsk' -
ForegroundColor Green; Chkdsk /scan;
Write-Host '`n(2/4) SFC - 1st scan' -ForegroundColor Green; sfc /scannow;
Write-Host '`n(3/4) DISM' -ForegroundColor Green; DISM /Online /Cleanup-
Image /Restorehealth;
Write-Host '`n(4/4) SFC - 2nd scan' -ForegroundColor Green; sfc /scannow;
Read-Host '`nPress Enter to Continue'" -verb runas
})
$WPFPanelAutologin.Add_Click({
curl.exe -ss "https://live.sysinternals.com/Autologon.exe" -o autologin.exe
# Official Microsoft recommendation
https://learn.microsoft.com/en-us/sysinternals/downloads/autologon
cmd /c autologin.exe
})
$WPFPanelcontrol.Add_Click({
cmd /c control
})
$WPFPanelnetwork.Add_Click({
cmd /c ncpa.cpl
})
$WPFPanelpower.Add_Click({
cmd /c powercfg.cpl
})
$WPFPanelsound.Add_Click({
cmd /c mmsys.cpl
})
$WPFPanelsystem.Add_Click({
cmd /c sysdm.cpl
})
$WPFPaneluser.Add_Click({
cmd /c "control userpasswords2"
})
#===========================================================================
# Tab 4 - Updates Buttons
#===========================================================================
$WPFUpdatesdefault.Add_Click({
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\
AU")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
WindowsUpdate\AU" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 3
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
DeliveryOptimization\Config")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
DeliveryOptimization\Config" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1
$services = @(
"BITS"
"wuauserv"
)
$WPFFixesUpdate.Add_Click({
### Reset Windows Update Script - reregister dlls, services, and remove
registry entires.
Write-Host "1. Stopping Windows Update Services..."
Stop-Service -Name BITS
Stop-Service -Name wuauserv
Stop-Service -Name appidsvc
Stop-Service -Name cryptsvc
$ButtonType = [System.Windows.MessageBoxButton]::OK
$MessageboxTitle = "Reset Windows Update "
$Messageboxbody = ("Stock settings loaded.`n Please reboot your computer")
$MessageIcon = [System.Windows.MessageBoxImage]::Information
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle,
$ButtonType, $MessageIcon)
Write-Host "================================="
Write-Host "-- Reset ALL Updates to Factory -"
Write-Host "================================="
})
$WPFUpdatesdisable.Add_Click({
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\
AU")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
WindowsUpdate\AU" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 1
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
DeliveryOptimization\Config")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
DeliveryOptimization\Config" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 0
$services = @(
"BITS"
"wuauserv"
)
$ButtonType = [System.Windows.MessageBoxButton]::OK
$MessageboxTitle = "Set Security Updates"
$Messageboxbody = ("Recommended Update settings loaded")
$MessageIcon = [System.Windows.MessageBoxImage]::Information
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle,
$ButtonType, $MessageIcon)
Write-Host "================================="
Write-Host "-- Updates Set to Recommended ---"
Write-Host "================================="
})
#===========================================================================
# Shows the form
#===========================================================================
Get-FormVariables
$Form.ShowDialog() | out-null
Stop-Transcript