diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..1113d70e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/dump +winget* \ No newline at end of file diff --git a/Individual Scripts/LisaV1.ps1 b/Individual Scripts/LisaV1.ps1 new file mode 100755 index 00000000..c3c71bc6 --- /dev/null +++ b/Individual Scripts/LisaV1.ps1 @@ -0,0 +1,923 @@ +<# +Global Variables +#> +$ErrorActionPreference = 'SilentlyContinue' +del Log.log; Start-Transcript -Path 'Log.log' + +<# +Fetch Administrator SID for later HKCU injection through SYSTEM account, and mount. +Also Mount HKEY_CLASSES_ROOT. +#> +Write-Host "Fetching Administrator Account SID" -ForegroundColor Green +$objUser = New-Object System.Security.Principal.NTAccount("Administrator") +$strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier]) +$strSID.Value +Write-Host "Mount Administrator Registry Hive with alias HKU:\" -ForegroundColor Green +New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS\$strSID +New-PSDrive -PSProvider Registry -Name HKCR -Root HKEY_CLASSES_ROOT + +<# First remove capabilities and features before further configuration. #> +Write-Host "Changing Windows Capabilities..." -ForegroundColor Green + +if((Get-WindowsCapability -Name 'App.Support.QuickAssist~~~~0.0.1.0' -Online).State -eq "Installed") { + Remove-WindowsCapability -Online -Name 'App.Support.QuickAssist~~~~0.0.1.0' +} +if((Get-WindowsCapability -Name 'Hello.Face.17658~~~~0.0.1.0' -Online).State -eq "Installed") { + Remove-WindowsCapability -Online -Name 'Hello.Face.17658~~~~0.0.1.0' +} +if((Get-WindowsCapability -Name 'Hello.Face.Migration.17658~~~~0.0.1.0' -Online).State -eq "Installed") { + Remove-WindowsCapability -Online -Name 'Hello.Face.Migration.17658~~~~0.0.1.0' +} +if((Get-WindowsCapability -Name 'Language.Handwriting~~~en-US~0.0.1.0' -Online).State -eq "Installed") { + Remove-WindowsCapability -Online -Name 'Language.Handwriting~~~en-US~0.0.1.0' +} +if((Get-WindowsCapability -Name 'MathRecognizer~~~~0.0.1.0' -Online).State -eq "Installed") { + Remove-WindowsCapability -Online -Name 'MathRecognizer~~~~0.0.1.0' +} +if((Get-WindowsCapability -Name 'Media.WindowsMediaPlayer~~~~0.0.12.0' -Online).State -eq "Installed") { + Remove-WindowsCapability -Online -Name 'Media.WindowsMediaPlayer~~~~0.0.12.0' +} +if((Get-WindowsCapability -Name 'OneCoreUAP.OneSync~~~~0.0.1.0' -Online).State -eq "Installed") { + Remove-WindowsCapability -Online -Name 'OneCoreUAP.OneSync~~~~0.0.1.0' +} + +Write-Host "Changing Windows Optional Features..." -ForegroundColor Green + +if((Get-WindowsOptionalFeature -FeatureName 'Internet-Explorer-Optional-amd64' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'Internet-Explorer-Optional-amd64' -NoRestart +} +if((Get-WindowsOptionalFeature -FeatureName 'SmbDirect' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'SmbDirect' -NoRestart +} +if((Get-WindowsOptionalFeature -FeatureName 'SMB1Protocol' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'SMB1Protocol' -NoRestart +} +if((Get-WindowsOptionalFeature -FeatureName 'Microsoft-Windows-Client-EmbeddedExp-Package' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'Microsoft-Windows-Client-EmbeddedExp-Package' -NoRestart +} +if((Get-WindowsOptionalFeature -FeatureName 'WindowsMediaPlayer' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'WindowsMediaPlayer' -NoRestart +} +if((Get-WindowsOptionalFeature -FeatureName 'WCF-TCP-PortSharing45' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'WCF-TCP-PortSharing45' -NoRestart +} +if((Get-WindowsOptionalFeature -FeatureName 'WCF-Services45' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'WCF-Services45' -NoRestart +} +if((Get-WindowsOptionalFeature -FeatureName 'Printing-Foundation-InternetPrinting-Client' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'Printing-Foundation-InternetPrinting-Client' -NoRestart +} +if((Get-WindowsOptionalFeature -FeatureName 'FaxServicesClientPackage' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'FaxServicesClientPackage' -NoRestart +} +if((Get-WindowsOptionalFeature -FeatureName 'Printing-Foundation-Features' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'Printing-Foundation-Features' -NoRestart +} +if((Get-WindowsOptionalFeature -FeatureName 'WorkFolders-Client' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'WorkFolders-Client' -NoRestart +} +if((Get-WindowsOptionalFeature -FeatureName 'MSRDC-Infrastructure' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'MSRDC-Infrastructure' -NoRestart +} +if((Get-WindowsOptionalFeature -FeatureName 'SearchEngine-Client-Package' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'SearchEngine-Client-Package' -NoRestart +} +if((Get-WindowsOptionalFeature -FeatureName 'Printing-PrintToPDFServices-Features' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'Printing-PrintToPDFServices-Features' -NoRestart +} +if((Get-WindowsOptionalFeature -FeatureName 'Printing-XPSServices-Features' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'Printing-XPSServices-Features' -NoRestart +} +if((Get-WindowsOptionalFeature -FeatureName 'Windows-Defender-Default-Definitions' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'Windows-Defender-Default-Definitions' -NoRestart +} +if((Get-WindowsOptionalFeature -FeatureName 'NetFx4-AdvSrvs' -Online).State -eq "Enabled") { + Disable-WindowsOptionalFeature -Online -FeatureName 'NetFx4-AdvSrvs' -NoRestart +} + +<# Adjust Services #> +Write-Host "Adjusting services start type..." -ForegroundColor Green + +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\luafv"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\TrkWks"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\CDPUserSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\cbdhsvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\WSearch"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\BDESVC"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\CDPSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\DiagTrack"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\DoSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\DPS"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\DusmSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\iphlpsvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\RasMan"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\ShellHWDetection"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\smphost"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\Spooler"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\SstpSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\TabletInputService"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +#$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\UsoSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +#New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\WdiServiceHost"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\WdiSystemHost"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\DsmSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\NcbService"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\WPDBusEnum"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\WbioSrvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\UnistoreSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\WerSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\PimIndexMaintenanceSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\MapsBroker"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\LxpSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 3 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\StorSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 3 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\PolicyAgent"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\IKEEXT"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\dmwappushservice"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\NgcSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 3 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\LicenseManager"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 3 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\wlidsvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\TokenBroker"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 3 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\PhoneSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 3 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\NcaSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\irmon"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\irmon"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\FDResPub"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\fhsvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\ScDeviceEnum"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\CertPropSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\SessionEnv"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\TermService"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 2 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\CSC"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\CscService"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\wanarp"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\volmgrx"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\stisvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 3 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\wuauserv"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 3 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\Vid"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\spaceport"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\kdnic"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\rdpbus"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\BcastDVRUserService"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\GraphicsPerfSvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\SecurityHealthService"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\wscsvc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\storqosflt"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\rspndr"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\MsLldp"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\lltdio"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\gencounter"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\CldFlt"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\SgrmBroker"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\Themes"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\SgrmAgent"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\tsusbhub"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\NetBIOS"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\wcifs"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\FileCrypt"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\Dfsc"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\cdrom"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 3 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\afunix"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start" -PropertyType DWord -Value 4 -Force + +# Adjust Services Trigger/Failure Settings +sc.exe failure wuauserv actions= '""' reset= '""' +sc.exe triggerinfo wuauserv delete # We only want to trigger Windows Update service on manual cumulative updating. + + +<# Adjust Autorun Entries #> +Write-Host "Adjusting Autorun Entries" -ForegroundColor Green +Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Font Drivers" -Name "Adobe Type Manager" +New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32" -Name msacm.l3acm -PropertyType String -Value "" -Force +New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32" -Name msacm.l3acm -PropertyType String -Value "" -Force +New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32" -Name vidc.cvid -PropertyType String -Value "" -Force +New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32" -Name VIDC.RTV1 -PropertyType String -Value "" -Force +New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32" -Name VIDC.RTV1 -PropertyType String -Value "" -Force + +<# Disable Windows Components through Registry #> +Write-Host "Disable Windows Components through Registry." -ForegroundColor Green +# Remote Assistance +$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "fAllowFullControl" -PropertyType DWord -Value 0 -Force +New-ItemProperty -Path $Path -Name "fAllowToGetHelp" -PropertyType DWord -Value 0 -Force +# Disk Quota +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\DiskQuota"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Enable" -PropertyType DWord -Value 0 -Force +$Path = "HKU:\Software\Policies\Microsoft\Windows\Explorer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "HidePeopleBar" -PropertyType DWord -Value 1 -Force +# Previous Versions +$Path = "HKLM:\Software\Policies\Microsoft\PreviousVersions"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DisableBackupRestore" -PropertyType DWord -Value 1 -Force +$Path = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NoPreviousVersionsPage" -PropertyType DWord -Value 1 -Force +# Offline Files +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\NetCache"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Enabled" -PropertyType DWord -Value 0 -Force +# File History +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\FileHistory"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Disabled" -PropertyType DWord -Value 1 -Force +# AutoPlay (Disable for All Drives) +$Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NoDriveTypeAutoRun" -PropertyType DWord -Value 255 -Force +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DisableAutoplay" -PropertyType Dword -Value 1 -Force +# Mobility Center +$Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\MobilityCenter"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NoMobilityCenter" -PropertyType DWord -Value 1 -Force +# Taskview (+Taskbar Icon) +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "ShowTaskViewButton" -PropertyType Dword -Value 0 -Force +# Notification Center (+Taskbar Icon) +$Path = "HKU:\SOFTWARE\Policies\Microsoft\Windows\Explorer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DisableNotificationCenter" -PropertyType Dword -Value 1 -Force +# CD Burning +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NoCDBurning" -PropertyType Dword -Value 1 -Force +# Miracast +$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "PlatformSupportMiracast" -PropertyType Dword -Value 0 -Force +# Phone Linking / Shared Experience +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "EnableMmx" -PropertyType Dword -Value 0 -Force + +<# Windows Security and Privacy through Registry #> +Write-Host "Adjusting Windows Security and Privacy through Registry" -ForegroundColor Green +# Root Certificate Updates +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\SystemCertificates\AuthRoot"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DisableRootAutoUpdate" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "EnableDisallowedCertAutoUpdate" -PropertyType Dword -Value 0 -Force +# Telemetry (Security) / Opt-in Notification +# $Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +# New-ItemProperty -Path $Path -Name "AllowTelemetry" -PropertyType Dword -Value 0 -Force +# New-ItemProperty -Path $Path -Name "DisableTelemetryOptInChangeNotification" -PropertyType Dword -Value 1 -Force +# $Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +# New-ItemProperty -Path $Path -Name "AllowTelemetry" -PropertyType Dword -Value 0 -Force + +# Application Compatibility +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "AITEnable" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "DisableEngine" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "DisablePCA" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "DisablePcaUI" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "DisableInventory" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "SbEnable" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "DisableUAR" -PropertyType Dword -Value 1 -Force +# Disable Automatic Online Activation / Validation Telemetry +$Path = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Activation"; if(-not (Test-Path -LiteralPath $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Manual" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "NotificationDisabled" -PropertyType Dword -Value 1 -Force +# Bluetooth Marketing Advertising +$Path = "HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Bluetooth"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "AllowAdvertising" -PropertyType Dword -Value 0 -Force +# Windows Help Experience Improvement Program +$Path = "HKU:\Software\Policies\Microsoft\Assistance"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +$Path = "HKU:\Software\Policies\Microsoft\Assistance\Client"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +$Path = "HKU:\Software\Policies\Microsoft\Assistance\Client\1.0"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NoImplicitFeedback" -PropertyType Dword -Value 1 -Force +# Peer to Peer services +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Peernet"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Disabled" -PropertyType Dword -Value 1 -Force +# CEIP +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\SQMClient"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\SQMClient\Windows"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "CEIPEnable" -PropertyType Dword -Value 0 -Force +$Path = "HKLM:\SOFTWARE\Microsoft\SQMClient\Windows"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "CEIPEnable" -PropertyType Dword -Value 0 -Force +# Windows Update +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DisableWindowsUpdateAccess" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "ExcludeWUDriversInQualityUpdate" -PropertyType Dword -Value 1 -Force +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NoAutoUpdate" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "AUOptions" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "UseWUServer" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "NoAutoRebootWithLoggedOnUsers" -PropertyType Dword -Value 1 -Force +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\MRT"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DontOfferThroughWUAU" -PropertyType Dword -Value 1 -Force +# Windows Store +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "AutoDownload" -PropertyType Dword -Value 2 -Force +# Delivery Optimization +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DODownloadMode" -PropertyType Dword -Value 100 -Force +# Device/Vendor Metadata +$Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "PreventDeviceMetadataFromNetwork" -PropertyType Dword -Value 1 -Force +# Text/Ink Data Collection +$Path = "HKU:\Software\Microsoft\InputPersonalization"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "RestrictImplicitInkCollection" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "RestrictImplicitTextCollection" -PropertyType Dword -Value 1 -Force +$Path = "HKU:\Software\Microsoft\InputPersonalization\TrainedDataStore"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "HarvestContacts" -PropertyType Dword -Value 0 -Force +$Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "AllowLinguisticDataCollection" -PropertyType Dword -Value 0 -Force +$Path = "HKU:\Software\Microsoft\Input\TIPC"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Enabled" -PropertyType Dword -Value 0 -Force +$Path = "HKU:\Software\Microsoft\Personalization\Settings"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "AcceptedPrivacyPolicy" -PropertyType Dword -Value 0 -Force +# Clipboard History +#$Path = "HKLM:\Software\Policies\Microsoft\Windows\System"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +#New-ItemProperty -Path $Path -Name "AllowClipboardHistory" -PropertyType Dword -Value 0 -Force +# Settings Pane Online Tips/Help +$Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "AllowOnlineTips" -PropertyType Dword -Value 0 -Force +# Windows Ask Feedback +$Path = "HKU:\Software\Microsoft\Siuf"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +$Path = "HKU:\Software\Microsoft\Siuf\Rules"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NumberOfSIUFInPeriod" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "PeriodInNanoSeconds" -PropertyType Dword -Value 0 -Force +# Track Programs/Documents +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Start_TrackProgs" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "Start_TrackDocs" -PropertyType Dword -Value 0 -Force +# Website Access of Language List +$Path = "HKU:\Control Panel\International\User Profile"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "HttpAcceptLanguageOptOut" -PropertyType Dword -Value 1 -Force +# Startmenu/Taskbar Tracking +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NoInstrumentation" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "NoRecentDocsHistory" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "ClearRecentDocsOnExit" -PropertyType Dword -Value 1 -Force +$Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NoRecentDocsHistory" -PropertyType Dword -Value 1 -Force +# Login Screen Password Reveal +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CredUI"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DisablePasswordReveal" -PropertyType Dword -Value 1 -Force +# Content Delivery Manager +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "SilentInstalledAppsEnabled" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "SystemPaneSuggestionsEnabled" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "SoftLandingEnabled" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "ContentDeliveryAllowed" -PropertyType Dword -Value 0 -Force +# Typing Insights +$Path = "HKU:\Software\Microsoft\Input\Settings"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "InsightsEnabled" -PropertyType Dword -Value 0 -Force +# PerfTrack +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WDI"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d}"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "ScenarioExecutionEnabled" -PropertyType Dword -Value 0 -Force +# Online Front Provider +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "EnableFontProviders" -PropertyType Dword -Value 0 -Force +# Speech Model Update through BITS +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Speech"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "AllowSpeechModelUpdate" -PropertyType Dword -Value 0 -Force +# KMS Client Online AVS Validation +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NoGenTicket" -PropertyType Dword -Value 1 -Force +# Adobe Type Manager Font Driver (ATMFD) +$Path = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DisableATMFD" -PropertyType Dword -Value 1 -Force +# Tailored Experiences Diagnostic Data +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Privacy"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "TailoredExperiencesWithDiagnosticDataEnabled" -PropertyType Dword -Value 0 -Force +# Automatic Sign-in after restart +#$Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +#New-ItemProperty -Path $Path -Name "DisableAutomaticRestartSignOn" -PropertyType Dword -Value 1 -Force +# Microsoft Accounts Allowance +# $Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +# New-ItemProperty -Path $Path -Name "NoConnectedUser" -PropertyType Dword -Value 3 -Force +# UWP App Privacy except Microphone (Capability Access Manager) +# $Permissions = Get-ChildItem -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore' -Recurse -Depth 1 | Where-Object { $_.PSChildName -NotLike 'microphone'} +# ForEach ($item in $Permissions) { $path = $item -replace "HKEY_LOCAL_MACHINE","HKLM:"; Set-ItemProperty -Path $path -Name 'Value' -Value "Deny" -Force } + + +<# Remove Context Menu Handlers #> +Write-Host "Removing Context Menu Handlers" -ForegroundColor Green +$Path = "HKLM:\SOFTWARE\Classes\*\shellex\ContextMenuHandlers\EPP"; if(Test-Path -LiteralPath $Path){ + # Windows Defender + Remove-Item -LiteralPath "HKLM:\SOFTWARE\Classes\*\shellex\ContextMenuHandlers\EPP" + Remove-Item -LiteralPath "HKLM:\SOFTWARE\Classes\Drive\shellex\ContextMenuHandlers\EPP" + Remove-Item -LiteralPath "HKLM:\SOFTWARE\Classes\Directory\shellex\ContextMenuHandlers\EPP" + # Cast to Device + $Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } + New-ItemProperty -Path $Path -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -PropertyType String -Value "" -Force + # Edit with Paint 3D / Rotate Image / 3D Print + $Context = Get-ChildItem -Path 'HKCR:\SystemFileAssociations' -Recurse -Depth 4 | Where-Object { $_.PSChildName } + ForEach ($item in $Context) { $path = $item -replace "HKEY_CLASSES_ROOT","HKCR:"; Remove-Item -Path $path -Include '3D Edit','ShellImagePreview','3D Print' -Recurse -Force -Confirm:$False } + # Give Access To + Remove-Item -LiteralPath "HKCR:\*\shellex\ContextMenuHandlers\Sharing" -Recurse:$True -Confirm:$False + Remove-Item -LiteralPath "HKCR:\Directory\Background\shellex\ContextMenuHandlers\Sharing" -Recurse:$True -Confirm:$False + Remove-Item -LiteralPath "HKCR:\Directory\shellex\ContextMenuHandlers\Sharing" -Recurse:$True -Confirm:$False + Remove-Item -LiteralPath "HKCR:\Directory\shellex\CopyHookHandlers\Sharing" -Recurse:$True -Confirm:$False + Remove-Item -LiteralPath "HKCR:\Drive\shellex\ContextMenuHandlers\Sharing" -Recurse:$True -Confirm:$False + Remove-Item -LiteralPath "HKCR:\Drive\shellex\PropertySheetHandlers\Sharing" -Recurse:$True -Confirm:$False + Remove-Item -LiteralPath "HKCR:\LibraryFolder\background\shellex\ContextMenuHandlers\Sharing" -Recurse:$True -Confirm:$False + Remove-Item -LiteralPath "HKCR:\UserLibraryFolder\shellex\ContextMenuHandlers\Sharing" -Recurse:$True -Confirm:$False + # Include in Library + Remove-Item -LiteralPath "HKCR:\Folder\ShellEx\ContextMenuHandlers\Library Location" -Recurse:$True -Confirm:$False + # Modern Sharing + Remove-Item -LiteralPath "HKCR:\*\shellex\ContextMenuHandlers\ModernSharing" -Recurse:$True -Confirm:$False + # New Contact + Remove-Item -LiteralPath "HKCR:\.contact\ShellNew" -Recurse:$True -Confirm:$False + # Pin Quick Access + Remove-Item -LiteralPath "HKCR:\Folder\shell\pintohome" -Recurse:$True -Confirm:$False + Remove-Item -LiteralPath "HKLM:\SOFTWARE\Classes\Folder\shell\pintohome" -Recurse:$True -Confirm:$False + # Pin to Start + Remove-Item -LiteralPath "HKCR:\Folder\shellex\ContextMenuHandlers\PintoStartScreen" -Recurse:$True -Confirm:$False + Remove-Item -LiteralPath "HKCR:\exefile\shellex\ContextMenuHandlers\PintoStartScreen" -Recurse:$True -Confirm:$False + Remove-Item -LiteralPath "HKCR:\Microsoft.Website\ShellEx\ContextMenuHandlers\PintoStartScreen" -Recurse:$True -Confirm:$False + Remove-Item -LiteralPath "HKCR:\mscfile\shellex\ContextMenuHandlers\PintoStartScreen" -Recurse:$True -Confirm:$False + # Troubleshoot + $Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } + New-ItemProperty -Path $Path -Name "{1d27f844-3a1f-4410-85ac-14651078412d}" -PropertyType String -Value "" -Force + Remove-Item -LiteralPath "HKCR:\lnkfile\shellex\ContextMenuHandlers\Compatibility" -Recurse:$True -Confirm:$False + # Send To + Remove-Item -LiteralPath "HKCR:\AllFilesystemObjects\shellex\ContextMenuHandlers\SendTo" -Recurse:$True -Confirm:$False + Remove-Item -LiteralPath "HKCR:\UserLibraryFolder\shellex\ContextMenuHandlers\SendTo" -Recurse:$True -Confirm:$False +} + + +<# Remove Sound Scheme #> +Write-Host "Removing Sound Scheme" -ForegroundColor Green +$sid = $strSID.Value +$SoundScheme = Get-ChildItem -Path 'HKU:\AppEvents\Schemes\Apps' -Recurse -Depth 3 | Where-Object { $_.PSChildName } +ForEach ($item in $SoundScheme) { $path = $item -replace [regex]::Escape("HKEY_USERS\$sid"),"HKU:"; Set-ItemProperty -LiteralPath $path -Name '(Default)' -Value "" -Force } + + +<# General Windows Configuration #> +Write-Host "Setting General Windows Configuration through Registry" -ForegroundColor Green +# NTP Timeserver +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\Parameters"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NtpServer" -PropertyType String -Value "0.pool.ntp.org,0x9" -Force +# Region Settings +$Path = "HKU:\Control Panel\International"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "sShortDate" -PropertyType String -Value "dd-MMM-yy" -Force +New-ItemProperty -Path $Path -Name "sShortTime" -PropertyType String -Value "HH:mm" -Force +New-ItemProperty -Path $Path -Name "sTimeFormat" -PropertyType String -Value "HH:mm:ss" -Force +New-ItemProperty -Path $Path -Name "iFirstDayOfWeek" -PropertyType String -Value "0" -Force +# Verbose Boot/Reboot Messages +#$Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +#New-ItemProperty -Path $Path -Name "VerboseStatus" -PropertyType Dword -Value 1 -Force +# Use Only Latest CLR (NET) +$Path = "HKLM:\SOFTWARE\Microsoft\.NETFramework"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "OnlyUseLatestCLR" -PropertyType Dword -Value 1 -Force +$Path = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "OnlyUseLatestCLR" -PropertyType Dword -Value 1 -Force +# Show BSOD instead of smiley +$Path = "HKLM:\System\CurrentControlSet\Control\CrashControl"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DisplayParameters" -PropertyType Dword -Value 1 -Force +# Disable Automatic Crash Debugging +Remove-Item -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\AeDebug" -Force -Recurse -Confirm:$False +# Network Icon on logon screen +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DontDisplayNetworkSelectionUI" -PropertyType Dword -Value 1 -Force +# Low Disk Space Checks +$Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NoLowDiskSpaceChecks" -PropertyType Dword -Value 1 -Force +# Shutdown Button without Login +$Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "shutdownwithoutlogon" -PropertyType Dword -Value 1 -Force +# Recently Added Apps in Start Menu +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "HideRecentlyAddedApps" -PropertyType Dword -Value 1 -Force +# Auto Restart after BSOD +$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "AutoReboot" -PropertyType Dword -Value 0 -Force +# Classic Volume Mixer +$Path = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MTCUVC"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "EnableMtcUvc" -PropertyType Dword -Value 0 -Force +# Chkdsk 10 second timeout. +$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "AutoChkTimeout" -PropertyType Dword -Value 10 -Force +# Hide Fonts Based on Language Settings +$Path = "HKU:\Software\Microsoft\Windows NT\CurrentVersion\Font Management"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Auto Activation Mode" -PropertyType Dword -Value 1 -Force +# Click-once to Login +#$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +#New-ItemProperty -Path $Path -Name "NoLockScreen" -PropertyType Dword -Value 1 -Force +# Disable Crash Dumps +$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "CrashDumpEnabled" -PropertyType Dword -Value 0 -Force +# Explorer Icon Cache Size +$Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Max Cached Icons" -PropertyType String -Value "8192" -Force +# Disable Language Switch Hotkeys +$Path = "HKU:\Keyboard Layout\Toggle"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Language Hotkey" -PropertyType String -Value "3" -Force +New-ItemProperty -Path $Path -Name "Hotkey" -PropertyType String -Value "3" -Force +New-ItemProperty -Path $Path -Name "Layout Hotkey" -PropertyType String -Value "3" -Force +# Disable Sticky/Filter/Toggle Hotkeys +$Path = "HKU:\Control Panel\Accessibility\StickyKeys"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Flags" -PropertyType String -Value "506" -Force +$Path = "HKU:\Control Panel\Accessibility\Keyboard Response"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Flags" -PropertyType String -Value "122" -Force +$Path = "HKU:\Control Panel\Accessibility\ToggleKeys"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Flags" -PropertyType String -Value "58" -Force +# Disable F1 Help Key +$Path = "HKU:\SOFTWARE\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee}\1.0\0\win32"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path -Force} +New-ItemProperty -Path $Path -Name "(Default)" -PropertyType String -Value "" -Force +$Path = "HKU:\SOFTWARE\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee}\1.0\0\win64"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path -Force} +New-ItemProperty -Path $Path -Name "(Default)" -PropertyType String -Value "" -Force +# Disable Network Location Wizard +$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\Network\NetworkLocationWizard"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "HideWizard" -PropertyType Dword -Value 1 -Force +# Disable New Network Location Window +$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +# Disable Automatic Setup of Network Connected Devices +$Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\NcdAutoSetup\Private"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "AutoSetup" -PropertyType Dword -Value 0 -Force +# Don't Notify When Clock Changes +$Path = "HKU:\Control Panel\TimeDate"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DstNotification" -PropertyType Dword -Value 0 -Force +# Hide/Show Disabled/Disconnected Audio Devices +#$Path = "HKU:\Software\Microsoft\Multimedia\Audio\DeviceCpl"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +#New-ItemProperty -Path $Path -Name "ShowHiddenDevices" -PropertyType Dword -Value 0 -Force +#New-ItemProperty -Path $Path -Name "ShowDisconnectedDevices" -PropertyType Dword -Value 1 -Force +# Disable Windows Detects Communications Activity +$Path = "HKU:\Software\Microsoft\Multimedia\Audio"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "UserDuckingPreference" -PropertyType Dword -Value 3 -Force +# Disable Modern Push Notifications +$Path = "HKU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NoToastApplicationNotification" -PropertyType Dword -Value 1 -Force +# Disable Spelling/Typing Related Aid. +$Path = "HKU:\Software\Microsoft\TabletTip\1.7"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "EnableAutocorrection" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "EnableSpellchecking" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "EnableTextPrediction" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "EnablePredictionSpaceInsertion" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "EnableDoubleTapSpace" -PropertyType Dword -Value 0 -Force +# GameBar/GameDVR Related +New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR"; New-ItemProperty -Name AllowGameDVR -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.GameBar.PresenceServer.Internal.PresenceWriter" -Name ActivationType -PropertyType Dword -Value 0 -Force +$Path = "HKU:\SOFTWARE\Microsoft\GameBar"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "UseNexusForGameBarEnabled" -PropertyType Dword -Value 0 -Force +$Path = "HKU:\System\GameConfigStore"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "GameDVR_Enabled" -PropertyType Dword -Value 0 -Force +# Enable/Disable Full Screen Optimizations (All to 0 is On) +#$Path = "HKU:\System\GameConfigStore"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +#New-ItemProperty -Path $Path -Name "GameDVR_DXGIHonorFSEWindowsCompatible" -PropertyType Dword -Value 1 -Force +#New-ItemProperty -Path $Path -Name "GameDVR_EFSEFeatureFlags" -PropertyType Dword -Value 0 -Force +#New-ItemProperty -Path $Path -Name "GameDVR_FSEBehavior" -PropertyType Dword -Value 2 -Force +#New-ItemProperty -Path $Path -Name "GameDVR_FSEBehaviorMode" -PropertyType Dword -Value 2 -Force +#New-ItemProperty -Path $Path -Name "GameDVR_HonorUserFSEBehaviorMode" -PropertyType Dword -Value 1 -Force +# Game Mode On/Off +#$Path = "HKU:\Software\Microsoft\GameBar"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +#New-ItemProperty -Path $Path -Name "AutoGameModeEnabled" -PropertyType Dword -Value 0 -Force + +<# Explorer/Desktop Related Configuration #> +# Search whole filesystem instead of using Index +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Search\Preferences"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "WholeFileSystem" -PropertyType Dword -Value 1 -Force +# Disable Explorer Search History +$Path = "HKU:\Software\Policies\Microsoft\Windows\Explorer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DisableSearchBoxSuggestions" -PropertyType Dword -Value 1 -Force +# Disable Sharing Wizard +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "SharingWizardOn" -PropertyType Dword -Value 0 -Force +# Hide Folder Merge Conflicts +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "HideMergeConflicts" -PropertyType Dword -Value 1 -Force +# Disable Aero Shake +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DisallowShaking" -PropertyType Dword -Value 1 -Force +# Disable Aero Snap Assist +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "SnapAssist" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "JointResize" -PropertyType Dword -Value 0 -Force +# Maximum Wallpaper JPEG Quality +$Path = "HKU:\Control Panel\Desktop"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "JPEGImportQuality" -PropertyType Dword -Value 999 -Force +# Always Desktop-Mode +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\ImmersiveShell"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "TabletMode" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "SignInMode" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "ConvertibleSlateModePromptPreference" -PropertyType Dword -Value 2 -Force +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "TaskbarAutoHideInTabletMode" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "TaskbarAppsVisibleInTabletMode" -PropertyType Dword -Value 1 -Force +# UWP Disable Dynamic Scrollbars +$Path = "HKU:\Control Panel\Accessibility"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DynamicScrollbars" -PropertyType Dword -Value 0 -Force +# Change Application Start/Shutdown Delay +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Serialize"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "StartupDelayInMSec" -PropertyType Dword -Value 1872 -Force +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Shutdown\Serialize"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "StartupDelayInMSec" -PropertyType Dword -Value 0 -Force +# Show/Hide Explorer Menus +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "AlwaysShowMenus" -PropertyType Dword -Value 0 -Force +# Disable Search the Microsoft Store +$Path = "HKLM:\Software\Policies\Microsoft\Windows\Explo‌​rer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NoUseStoreOpenWith" -PropertyType DWord -Value 1 -Force +# Explorer Thumbnail Cache +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NoThumbnailCache" -PropertyType Dword -Value 1 -Force +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DisableThumbnailCache" -PropertyType Dword -Value 1 -Force +# No New App Alert +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NoNewAppAlert" -PropertyType Dword -Value 1 -Force +# Disable Touch Screen Gestures +$Path = "HKU:\Control Panel\Cursors"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "ContactVisualization" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "GestureVisualization" -PropertyType Dword -Value 0 -Force +# Disable Network Drive Mapping icon error in tray +$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\NetworkProvider"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "RestoreConnection" -PropertyType Dword -Value 0 -Force +# Disable Explorer Quick Access +$Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "HubMode" -PropertyType Dword -Value 1 -Force +# Disable Themes Ability to Change Sounds, Wallpapers, Icons, etc. +$Path = "HKU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "ThemeChangesDesktopIcons" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "ThemeChangesMousePointers" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "ColorSetFromTheme" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "WallpaperSetFromTheme" -PropertyType Dword -Value 0 -Force +$Path = "HKU:\Software\Policies\Microsoft\Windows\Personalization"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NoChangingSoundScheme" -PropertyType Dword -Value 1 -Force +# Explorer Animation / Shortcut Resolve Speed +$Path = "HKU:\Control Panel\Mouse"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "MouseHoverTime" -PropertyType String -Value "1" -Force +$Path = "HKU:\Control Panel\Desktop"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "MenuShowDelay" -PropertyType String -Value "1" -Force +$Path = "HKU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "LinkResolveIgnoreLinkInfo" -PropertyType Dword -Value "1" -Force +New-ItemProperty -Path $Path -Name "NoResolveSearch" -PropertyType Dword -Value "1" -Force +New-ItemProperty -Path $Path -Name "NoResolveTrack" -PropertyType Dword -Value "1" -Force + +<# Configure DPI / Text Scaling + Mouse 1:1 Movement #> +Write-Host "Configure DPI Preferences" -ForegroundColor Green +# Windows 8 (Custom DPI) Scaling +$Path = "HKU:\Control Panel\Desktop"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Win8DpiScaling" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "DpiScalingVer" -PropertyType Dword -Value 4096 -Force +# High DPI Aware Executables +$Path = "HKU:\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "C:\Windows\System32\mmc.exe" -PropertyType String -Value "~ HIGHDPIAWARE" -Force +New-ItemProperty -Path $Path -Name "C:\Windows\System32\msiexec.exe" -PropertyType String -Value "~ HIGHDPIAWARE" -Force +New-ItemProperty -Path $Path -Name "C:\Windows\System32\perfmon.exe" -PropertyType String -Value "~ HIGHDPIAWARE" -Force +# We always want to dictate custom DPI % even at common values i.e. 100%/125%/150%. This solves some issues with window locations / blurry taskbar icons after resolution change / alt+tab + +<# Low-level Configuration #> +Write-Host "Set Low-level Configuration" -ForegroundColor Green +# UWP Swap File +$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "SwapfileControl" -PropertyType Dword -Value 0 -Force +# NTFS +$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NtfsDisable8dot3NameCreation" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "NtfsDisableLastAccessUpdate" -PropertyType Dword -Value -2147483647 -Force +New-ItemProperty -Path $Path -Name "LongPathsEnabled" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "NtfsDisableCompression" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "NtfsEncryptPagingFile" -PropertyType Dword -Value 1 -Force + +<# Power Management #> +Write-Host "Set Power Management Configuration" -ForegroundColor Green +# Fast Startup +$Path = "HKLM:\System\CurrentControlSet\Control\Session Manager\Power"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "HiberbootEnabled" -PropertyType Dword -Value 0 -Force +# Expose all unhidden power plan options +$PowerSettings = Get-ChildItem -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings' -Recurse -Depth 1 | Where-Object { $_.PSChildName -NotLike 'DefaultPowerSchemeValues' -and $_.PSChildName -NotLike '0' -and $_.PSChildName -NotLike '1' } +ForEach ($item in $PowerSettings) { $path = $item -replace "HKEY_LOCAL_MACHINE","HKLM:"; Set-ItemProperty -Path $path -Name 'Attributes' -Value 2 -Force } + +<# Network General/Protocol Configuration #> +Write-Host "Set General Networking Configuration" -ForegroundColor Green +Set-NetIPinterface -InterfaceAlias '*' -NlMtuBytes 1440 +Set-NetTCPSetting -EcnCapability Enable +Set-NetAdapterBinding -Name '*' -DisplayName 'Client for Microsoft Networks' -Enabled 0 -ea SilentlyContinue +Set-NetAdapterBinding -Name '*' -DisplayName 'Internet Protocol Version 6 (TCP/IPv6)' -Enabled 0 -ea SilentlyContinue +Set-NetAdapterBinding -Name '*' -DisplayName 'Microsoft LLDP Protocol Driver' -Enabled 0 -ea SilentlyContinue +Set-NetAdapterBinding -Name '*' -DisplayName 'Link-Layer Topology Discovery Responder' -Enabled 0 -ea SilentlyContinue +Set-NetAdapterBinding -Name '*' -DisplayName 'Link-Layer Topology Discovery Mapper I/O Driver' -Enabled 0 -ea SilentlyContinue +Set-NetAdapterBinding -Name '*' -DisplayName 'QoS Packet Scheduler' -Enabled 0 -ea SilentlyContinue +Set-NetAdapterBinding -Name '*' -DisplayName 'Hyper-V Extensible Virtual Switch' -Enabled 0 -ea SilentlyContinue +Set-NetAdapterBinding -Name '*' -DisplayName 'Microsoft Network Adapter Multiplexor Protocol' -Enabled 0 -ea SilentlyContinue +Set-NetAdapterBinding -Name '*' -DisplayName 'Microsoft NDIS Capture' -AllBindings -Enabled 0 -ea SilentlyContinue +Set-NetAdapterBinding -Name '*' -DisplayName 'Microsoft RDMA - NDK' -AllBindings -Enabled 0 -ea SilentlyContinue +Set-NetAdapterBinding -Name '*' -DisplayName 'NetBIOS Interface' -AllBindings -Enabled 0 -ea SilentlyContinue +Set-NetAdapterBinding -Name '*' -DisplayName 'NDIS Usermode I/O Protocol' -AllBindings -Enabled 0 -ea SilentlyContinue +Set-NetAdapterBinding -Name '*' -DisplayName 'Point to Point Protocol Over Ethernet' -AllBindings -Enabled 0 -ea SilentlyContinue +Set-NetAdapterBinding -Name '*' -DisplayName 'WINS Client(TCP/IP) Protocol' -AllBindings -Enabled 0 -ea SilentlyContinue +Set-NetAdapterBinding -Name '*' -DisplayName 'NDIS Usermode I/O Protocol' -AllBindings -Enabled 0 -ea SilentlyContinue +#VMware Adapter (NAT) +Set-NetAdapterBinding -Name 'VMware Network Adapter VMNet8' -DisplayName 'Client For Microsoft Networks' -AllBindings -Enabled 0 -ea SilentlyContinue +Set-NetAdapterBinding -Name 'VMware Network Adapter VMNet8' -DisplayName 'File and Printer Sharing for Microsoft Networks' -AllBindings -Enabled 0 -ea SilentlyContinue + +# Disable Nagle's Algorithm on all interfaces +#$i = 'HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces' +#Get-ChildItem $i | ForEach-Object { +# Set-ItemProperty -Path "$i\$($_.pschildname)" -name TcpAckFrequency -value 1 +# Set-ItemProperty -Path "$i\$($_.pschildname)" -name TCPNoDelay -value 1 +#} + +# Disable NetBIOS on all interfaces +$i = 'HKLM:\SYSTEM\CurrentControlSet\Services\netbt\Parameters\interfaces' +Get-ChildItem $i | ForEach-Object { + Set-ItemProperty -Path "$i\$($_.pschildname)" -name NetBiosOptions -value 2 +} + +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "EnableMulticast" -PropertyType Dword -Value 1 -Force +New-ItemProperty -Path $Path -Name "RegistrationEnabled" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "DisableSmartNameResolution" -PropertyType Dword -Value 1 -Force +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\NetworkConnectivityStatusIndicator"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "NoActiveProbe" -PropertyType Dword -Value 1 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "EnableActiveProbing" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "ActiveDnsProbeContent" -PropertyType String -Value "192.168.1.1:8080" -Force +New-ItemProperty -Path $Path -Name "ActiveDnsProbeHost" -PropertyType String -Value "192.168.1.1:8080" -Force +New-ItemProperty -Path $Path -Name "ActiveWebProbeHost" -PropertyType String -Value "192.168.1.1:8080" -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DisabledComponents" -PropertyType Dword -Value 0x00000020 -Force # Prefer ipv4 over ivp6, recommended instead of disabling +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LLTD"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "EnableLLTDIO" -PropertyType Dword -Value 0 -Force +New-ItemProperty -Path $Path -Name "EnableRspndr" -PropertyType Dword -Value 0 -Force +# $Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\TCPIP\v6Transition"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +# New-ItemProperty -Path $Path -Name "6to4_State" -PropertyType String -Value "Disabled" -Force +# New-ItemProperty -Path $Path -Name "ISATAP_State" -PropertyType String -Value "Disabled" -Force +# New-ItemProperty -Path $Path -Name "Teredo_State" -PropertyType String -Value "Disabled" -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\services\Tcpip\QoS"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Do not use NLA" -PropertyType String -Value "1" -Force +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "fMinimizeConnections" -PropertyType Dword -Value "1" -Force +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\HotspotAuthentication"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Enabled" -PropertyType Dword -Value "0" -Force +$Path = "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "AutoConnectAllowedOEM" -PropertyType Dword -Value "0" -Force +$Path = "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "value" -PropertyType Dword -Value "0" -Force +$Path = "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "value" -PropertyType Dword -Value "0" -Force +$Path = "HKLM:\SOFTWARE\Microsoft\WlanSvc\AnqpCache"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "OsuRegistrationStatus" -PropertyType Dword -Value "0" -Force + +<# SMB Server Configuration #> +Write-Host "Setting up Samba Configuration" -ForegroundColor Green +New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name LocalAccountTokenFilterPolicy -PropertyType Dword -Value 1 -Force # Enable Administrative Shares +Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force +# SMB Client Configuration +Set-SmbClientConfiguration -EnableInsecureGuestLogons 0 -Force +Set-SmbClientConfiguration -EnableBandwidthThrottling 0 -Force + + +<# Remote Desktop Configuration #> +Write-Host "Configuring Remote Desktop" -ForegroundColor Green +# Enable Remote Desktop +$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "fDenyTSConnections" -PropertyType DWord -Value 0 -Force +# Don't Adjust Remote Session DPI +$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "IgnoreClientDesktopScaleFactor" -PropertyType Dword -Value 1 -Force +# Change Listening Port +$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "PortNumber" -PropertyType Dword -Value 11139 -Force +# Prioritize H.264/AVC 444 graphics mode for Remote Desktop Connections +#$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +#New-ItemProperty -Path $Path -Name "AVC444ModePreferred" -PropertyType Dword -Value 1 -Force +# Configure H.264/AVC Hardware encoding for Remote Desktop Connections +#$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +#New-ItemProperty -Path $Path -Name "AVCHardwareEncodePreferred" -PropertyType Dword -Value 1 -Force +# Increase DWM Frame Capture Interval (If not using AVC codec). 2 is the lowest before dwm.exe goes berserk. +$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "DWMFRAMEINTERVAL" -PropertyType Dword -Value 2 -Force +# RDP Compression Level (If not using AVC codec) +#$Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +#New-ItemProperty -Path $Path -Name "MaxCompressionLevel" -PropertyType Dword -Value 0 -Force + +<# Change Scheduled Tasks #> +Write-Host "Changing Default Scheduled Tasks" -ForegroundColor Green +# Disable all Windows Default Tasks, with exceptions. +Get-ScheduledTask -TaskPath "\Microsoft\*" | Where-Object {$_.Taskname -notmatch 'SynchronizeTime' -and $_.Taskname -notmatch 'MsCtfMonitor' -and $_.Taskname -notmatch 'RemoteFXvGPUDisableTask' ` +-and $_.Taskname -notmatch 'ResPriStaticDbSync' -and $_.Taskname -notmatch 'WsSwapAssessmentTask' -and $_.Taskname -notmatch 'Sysprep Generalize Drivers' -and $_.Taskname -notmatch 'Device Install Group Policy' ` + -and $_.Taskname -notmatch 'DXGIAdapterCache' -and $_.Taskname -notmatch 'UninstallDeviceTask'} | Disable-ScheduledTask + +<# Configure Logging (Event/Channels/WMI #> +Write-Host "Configure Logging" -ForegroundColor Green +<# Event Log Configuration #> +(Get-WinEvent -ListLog *).LogName | %{[System.Diagnostics.Eventing.Reader.EventLogSession]::GlobalSession.ClearLog($_)} # Clear Event Log +# Change Individual Channels +$EventLog = Get-WinEvent -ListLog "Microsoft-Windows-LiveId/Operational"; $EventLog.IsEnabled = $false; $EventLog.SaveChanges() +$EventLog = Get-WinEvent -ListLog "Microsoft-Windows-CloudStore/Operational"; $EventLog.IsEnabled = $false; $EventLog.SaveChanges() +$EventLog = Get-WinEvent -ListLog "Microsoft-Windows-UniversalTelemetryClient/Operational"; $EventLog.IsEnabled = $false; $EventLog.SaveChanges() +$EventLog = Get-WinEvent -ListLog "Microsoft-Windows-WindowsSystemAssessmentTool/Operational"; $EventLog.IsEnabled = $false; $EventLog.SaveChanges() +$EventLog = Get-WinEvent -ListLog "Microsoft-Windows-ReadyBoost/Operational"; $EventLog.IsEnabled = $false; $EventLog.SaveChanges() +$EventLog = Get-WinEvent -ListLog "Microsoft-Windows-HelloForBusiness/Operational"; $EventLog.IsEnabled = $false; $EventLog.SaveChanges() +$EventLog = Get-WinEvent -ListLog "Microsoft-Windows-SettingSync/Debug"; $EventLog.IsEnabled = $false; $EventLog.SaveChanges() +$EventLog = Get-WinEvent -ListLog "Microsoft-Windows-Known Folders API Service"; $EventLog.IsEnabled = $false; $EventLog.SaveChanges() +$EventLog = Get-WinEvent -ListLog "Microsoft-Windows-SettingSync/Operational"; $EventLog.IsEnabled = $false; $EventLog.SaveChanges() +$EventLog = Get-WinEvent -ListLog "Microsoft-Windows-Store/Operational"; $EventLog.IsEnabled = $false; $EventLog.SaveChanges() +$EventLog = Get-WinEvent -ListLog "Microsoft-Windows-CAPI2/Operational"; $EventLog.IsEnabled = $true; $EventLog.SaveChanges() +$EventLog = Get-WinEvent -ListLog "Microsoft-Windows-Application-Experience/Program-Telemetry"; $EventLog.IsEnabled = $true; $EventLog.SaveChanges() # Actually logs program incompatibility and fixed applied +# Filter Harmless DistributedCOM logging in 'System'. +$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\WMI\Autologger\EventLog-System\{1b562e86-b7aa-4131-badc-b6f3a001407e}"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "Enabled" -PropertyType Dword -Value 0 -Force +# Disable all non-critical WMI loggers (Including third-party) +$Logger = Get-ChildItem -Path 'HKLM:\System\CurrentControlSet\Control\WMI\Autologger' -Recurse -Depth 1 | Where-Object { $_.PSChildName -NotLike 'Circular Kernel Context Logger' -and $_.PSChildName -NotLike 'EventLog-Application' ` + -and $_.PSChildName -NotLike 'EventLog-Security' -and $_.PSChildName -NotLike 'EventLog-System' } +ForEach ($item in $Logger) { $path = $item -replace "HKEY_LOCAL_MACHINE","HKLM:"; Set-ItemProperty -Path $path -Name 'Start' -Value 0 -Force } +# Disable Performance Counters (Causes Vmauthd errors) +#$Path = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +#New-ItemProperty -Path $Path -Name "Disable Performance Counters" -PropertyType Dword -Value 1 -Force + +<# Driver Adjustments #> +Write-Host "Change Low-level Driver Settings" -ForegroundColor Green +# Disable Devices in Devmgmt.msc that were already disabled through registry. (Get rid of exclamation mark) +Get-PnpDevice | Where-Object { $_.FriendlyName -match 'Remote Desktop Device Redirector Bus' } | Disable-PnpDevice -Confirm:$false -ea SilentlyContinue +Get-PnpDevice | Where-Object { $_.FriendlyName -match 'Microsoft Hyper-V Virtualization Infrastructure Driver' } | Disable-PnpDevice -Confirm:$false -ea SilentlyContinue +Get-PnpDevice | Where-Object { $_.FriendlyName -match 'Microsoft Storage Spaces Controller' } | Disable-PnpDevice -Confirm:$false -ea SilentlyContinue +Get-PnpDevice | Where-Object { $_.FriendlyName -match 'Microsoft Kernel Debug Network Adapter' } | Disable-PnpDevice -Confirm:$false -ea SilentlyContinue +Get-PnpDevice | Where-Object { $_.FriendlyName -match 'Remote Desktop USB Hub' } | Disable-PnpDevice -Confirm:$false -ea SilentlyContinue + +# Disable Line-based Interrupt Emulation on devices where 'MSISupported' key exist. (Mostly applies to In-box HD Audio driver on most platforms) +$MSIMode = Get-ChildItem -Path 'HKLM:\SYSTEM\CurrentControlSet\Enum\PCI' -Recurse -Depth 5 | Where-Object { $_.PSChildName -Like 'MessageSignaledInterruptProperties' } +ForEach ($item in $MSIMode) { $path = $item -replace "HKEY_LOCAL_MACHINE","HKLM:"; Set-ItemProperty -Path $path -Name 'MSISupported' -Value 1 -Force } + +# Change Mouse/Keyboard Event Buffer Size (Tested) +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\mouclass\Parameters"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "MouseDataQueueSize" -PropertyType Dword -Value 22 -Force +$Path = "HKLM:\SYSTEM\CurrentControlSet\Services\kbdclass\Parameters"; if(-not (Test-Path -Path $Path)){ New-Item -ItemType String -Path $Path } +New-ItemProperty -Path $Path -Name "KeyboardDataQueueSize" -PropertyType Dword -Value 22 -Force + +# Purge Temporary Directories and other files +Write-Host "Clean Windows Component Store (WinSxS) and Temporary Directories" -ForegroundColor Green +rm -r C:\Windows\SoftwareDistribution\* -Force +rm -r C:\Users\Administrator\AppData\Local\Temp\* -Force +Remove-Item c:\Users\Public\Desktop\desktop.ini -Force +Remove-Item c:\Users\Administrator\Desktop\desktop.ini -Force +dism /online /Cleanup-Image /StartComponentCleanup # Winsxs (Old updates) + +<# Script end #> +Stop-Transcript +Remove-PSDrive -Name HKU +Remove-PSDrive -Name HKCR +Write-Host "Script Done." -ForegroundColor Green \ No newline at end of file diff --git a/Individual Scripts/LisaV2.ps1 b/Individual Scripts/LisaV2.ps1 new file mode 100755 index 00000000..870a44f8 --- /dev/null +++ b/Individual Scripts/LisaV2.ps1 @@ -0,0 +1,410 @@ +#This provides the best Disable Things e.g New Windows 11 Install with 53 Proccesess, but it breaks + +Clear-Host +$Error.Clear() +IF ((Get-Culture).Name -eq "ru-RU") +{ + $RU = $true +} + +$services = @( + "CDPSvc", + "DiagTrack", + "DusmSvc", + "SSDPSRV" +) +Get-Service -Name $services | Stop-Service -Force +Get-Service -Name $services | Set-Service -StartupType Disabled +Update-AutologgerConfig -Name AutoLogger-Diagtrack-Listener -Start 0 +Update-AutologgerConfig -Name SQMLogger -Start 0 +New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Value 1 -Force +IF (-not (Test-Path -Path HKCU:\Software\Microsoft\Siuf\Rules)) +{ + New-Item -Path HKCU:\Software\Microsoft\Siuf\Rules -Force +} +New-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name NumberOfSIUFInPeriod -Value 0 -Force +$tasks = @( + "ProgramDataUpdater", + "Microsoft Compatibility Appraiser", + "Microsoft-Windows-DiskDiagnosticDataCollector", + "TempSignedLicenseExchange", + "MapsToastTask", + "DmClient", + "FODCleanupTask", + "DmClientOnScenarioDownload", + "BgTaskRegistrationMaintenanceTask", + "File History (maintenance mode)", + "WinSAT", + "UsbCeip", + "Consolidator", + "Proxy", + "MNO Metadata Parser", + "NetworkStateChangeTask", + "GatherNetworkInfo", + "XblGameSaveTask", + "EnableLicenseAcquisition", + "QueueReporting", + "FamilySafetyMonitor", + "FamilySafetyRefreshTask" +) +Get-ScheduledTask -TaskName $tasks | Disable-ScheduledTask +auditpol /set /subcategory:"{0CCE9226-69AE-11D9-BED3-505054503030}" /success:disable /failure:disable +# Delete temporary files that apps aren't using +New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 04 -Value 1 -Force +# Delete files in recycle bin if they have been there for over 30 days +New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 256 -Value 30 -Force +# Never delete files in "Downloads" folder +New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 512 -Value 0 -Force +# Turn off automatic installing suggested apps +New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SilentInstalledAppsEnabled -Value 0 -Force +# Hide "Windows Ink Workspace" button in taskbar +New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PenWorkspace -Name PenWorkspaceButtonDesiredVisibility -Value 0 -Force +# Do not offer tailored experiences based on the diagnostic data setting +New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Privacy -Name TailoredExperiencesWithDiagnosticDataEnabled -Value 0 -Force +# Do not let apps on other devices open and message apps on this device, and vice versa +New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\CDP -Name RomeSdkChannelUserAuthzPolicy -Value 0 -Force +# Turn off location for this device +New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location -Name Value -PropertyType String -Value Deny -Force +# Turn off hibernate +New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Power -Name HibernateEnabled -Value 0 -Force + +# Group svchost.exe processes +$ram = (Get-CimInstance -ClassName Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum).Sum / 1kb +New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control -Name SvcHostSplitThresholdInKB -Value $ram -Force +# Do not preserve zone information +IF (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments)) +{ + New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments -Force +} +New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments -Name SaveZoneInformation -Value 1 -Force +New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments -Name SaveZoneInformation -Value 1 -Force +# Turn off user first sign-in animation +New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableFirstLogonAnimation -Value 0 -Force +# Turn off "Look for an app in the Microsoft Store" in "Open with" dialog +IF (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer)) +{ + New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Force +} +New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoUseStoreOpenWith -Value 1 -Force +# Turn off "New App Installed" notification +New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoNewAppAlert -Value 1 -Force +# Turn off recently added apps on Start Menu +New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Value 1 -Force +# Turn off Windows Game Recording and Broadcasting +IF (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR)) +{ + New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR -Force +} +New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR -Name AllowgameDVR -Value 0 -Force +# Do not allow apps to use advertising ID +New-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Value 0 -Force +# Turn off Cortana +IF (-not $RU) +{ + IF (-not (Test-Path -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) + { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force + } + New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name AllowCortana -Value 0 -Force +} +# Do not allow Microsoft Edge to start and load the Start and New Tab page at Windows startup and each time Microsoft Edge is closed +IF (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\TabPreloader)) +{ + New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\TabPreloader -Force +} +New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\TabPreloader -Name AllowTabPreloading -Value 0 -Force +# Do not allow Microsoft Edge to pre-launch at Windows startup, when the system is idle, and each time Microsoft Edge is closed +IF (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main)) +{ + New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main -Force +} +New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main -Name AllowPrelaunch -Value 0 -Force +# Do not allow Windows 10 to manage default printer +New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Windows" -Name LegacyDefaultPrinterMode -Value 1 -Force +# Turn off JPEG desktop wallpaper import quality reduction +New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name JPEGImportQuality -Value 100 -Force +# Turn off sticky Shift key after pressing 5 times +New-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name Flags -PropertyType String -Value 506 -Force +# Turn off Windows features +$features = @( + # Windows Fax and Scan + "FaxServicesClientPackage", + # Legacy Components + "LegacyComponents", + # Media Features + "MediaPlayback", + # PowerShell 2.0 + "MicrosoftWindowsPowerShellV2", + "MicrosoftWindowsPowershellV2Root", + # Microsoft XPS Document Writer + "Printing-XPSServices-Features", + # Microsoft Print to PDF + "Printing-PrintToPDFServices-Features", + # Work Folders Client + "WorkFolders-Client" +) +foreach ($feature in $features) +{ + Disable-WindowsOptionalFeature -Online -FeatureName $feature -NoRestart +} +# Uninstall Onedrive +Stop-Process -Name OneDrive -Force -ErrorAction SilentlyContinue +Start-Process -FilePath "$env:SystemRoot\SysWOW64\OneDriveSetup.exe" -ArgumentList "/uninstall" -Wait +Stop-Process -Name explorer +IF (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive)) +{ + New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive -Force +} +New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive -Name DisableFileSyncNGSC -Value 1 -Force +New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive -Name DisableFileSync -Value 1 -Force +New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive -Name DisableMeteredNetworkFileSync -Value 0 -Force +New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive -Name DisableLibrariesDefaultSaveToOneDrive -Value 1 -Force +New-ItemProperty -Path HKCU:\Software\Microsoft\OneDrive -Name DisablePersonalSync -Value 1 -Force +Remove-ItemProperty -Path HKCU:\Environment -Name OneDrive -Force -ErrorAction SilentlyContinue +Remove-Item -Path $env:USERPROFILE\OneDrive -Recurse -Force -ErrorAction SilentlyContinue +Remove-Item -Path $env:LOCALAPPDATA\Microsoft\OneDrive -Recurse -Force -ErrorAction SilentlyContinue +Remove-Item -Path "$env:ProgramData\Microsoft OneDrive" -Recurse -Force -ErrorAction SilentlyContinue +Unregister-ScheduledTask -TaskName *OneDrive* -Confirm:$false + +# Turn off Game Bar +New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -Value 0 -Force +New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -Value 0 -Force +# Turn off Game Mode +New-ItemProperty -Path HKCU:\Software\Microsoft\GameBar -Name AllowAutoGameMode -Value 0 -Force +# Turn off Game Bar tips +New-ItemProperty -Path HKCU:\Software\Microsoft\GameBar -Name ShowStartupPanel -Value 0 -Force +# Enable System Restore +Enable-ComputerRestore -Drive $env:SystemDrive +Get-ScheduledTask -TaskName SR | Enable-ScheduledTask +Get-Service -Name swprv, vss | Set-Service -StartupType Manual +Get-Service -Name swprv, vss | Start-Service +Get-CimInstance -ClassName Win32_ShadowCopy | Remove-CimInstance +# Turn off Windows Script Host +New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Value 0 -Force +# Create scheduled task with the disk cleanup tool in Task Scheduler. The task runs every 90 days +$keys = @( + # Delivery Optimization Files + "Delivery Optimization Files", + # Device driver packages + "Device Driver Packages", + # Previous Windows Installation(s) + "Previous Installations", + "Setup Log Files", + # Temporary Setup Files + "Temporary Setup Files", + # Windows Update Cleanup + "Update Cleanup", + # Windows Defender Antivirus + "Windows Defender", + # Windows upgrade log files + "Windows Upgrade Log Files") +foreach ($key in $keys) +{ + New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$key" -Name StateFlags1337 -Value 2 -Force +} +$action = New-ScheduledTaskAction -Execute "cleanmgr.exe" -Argument "/sagerun:1337" +$trigger = New-ScheduledTaskTrigger -Daily -DaysInterval 90 -At 9am +$settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable +$principal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -RunLevel Highest +$params = @{ + "TaskName" = "Update Cleanup" + "Action" = $action + "Trigger" = $trigger + "Settings" = $settings + "Principal" = $principal +} +Register-ScheduledTask @params -Force +# Create task to clean out the "$env:SystemRoot\SoftwareDistribution\Download" folder in Task Scheduler.. The task runs on Thursdays every 4 weeks. +$action = New-ScheduledTaskAction -Execute powershell.exe -Argument @" + `$getservice = Get-Service -Name wuauserv + `$getservice.WaitForStatus("Stopped", "01:00:00") + Get-ChildItem -Path `$env:SystemRoot\SoftwareDistribution\Download -Recurse -Force | Remove-Item -Recurse -Force +"@ +$trigger = New-JobTrigger -Weekly -WeeksInterval 4 -DaysOfWeek Thursday -At 9am +$settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable +$principal = New-ScheduledTaskPrincipal -UserId System -RunLevel Highest +$params = @{ + "TaskName" = "SoftwareDistribution" + "Action" = $action + "Trigger" = $trigger + "Settings" = $settings + "Principal" = $principal +} +Register-ScheduledTask @params -Force +# Create scheduled task with the $env:TEMP folder cleanup in Task Scheduler. The task runs every 62 days +$action = New-ScheduledTaskAction -Execute powershell.exe -Argument @" + Get-ChildItem -Path `$env:TEMP -Force -Recurse | Remove-Item -Force -Recurse +"@ +$trigger = New-ScheduledTaskTrigger -Daily -DaysInterval 62 -At 9am +$settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable +$principal = New-ScheduledTaskPrincipal -UserId System -RunLevel Highest +$params = @{ + "TaskName" = "Temp" + "Action" = $action + "Trigger" = $trigger + "Settings" = $settings + "Principal" = $principal +} +Register-ScheduledTask @params -Force +# Turn off default background apps except +$apps = @( + # Content Delivery Manager + "Microsoft.Windows.ContentDeliveryManager*" + # Cortana + "Microsoft.Windows.Cortana*" + # Windows Security + # Безопасность Windows + # ShellExperienceHost + "Microsoft.Windows.ShellExperienceHost*" + # StartMenuExperienceHost + "Microsoft.Windows.StartMenuExperienceHost*") +foreach ($app in $apps) +{ + Get-ChildItem -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications -Exclude $apps | + ForEach-Object -Process { + New-ItemProperty -Path $_.PsPath -Name Disabled -Value 1 -Force + New-ItemProperty -Path $_.PsPath -Name DisabledByUser -Value 1 -Force + } +} +# Turn on .NET 4 runtime for all apps +New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Value 1 -Force +New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Value 1 -Force + +Until ($paths -match "`"") +# Turn on Windows Defender PUA Protection +Set-MpPreference -PUAProtection Enabled +# Turn on firewall & network protection +# Включить брандмауэр +Set-NetFirewallProfile -Enabled True +# Turn off F1 Help key +IF (-not (Test-Path -Path "HKCU:\Software\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee}\1.0\0\win64")) +{ + New-Item -Path "HKCU:\Software\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee}\1.0\0\win64" -Force +} +New-ItemProperty -Path "HKCU:\Software\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee}\1.0\0\win64" -Name "(default)" -PropertyType String -Value "" -Force +# Show Task Manager details +$taskmgr = Get-Process -Name Taskmgr -ErrorAction SilentlyContinue +IF ($taskmgr) +{ + $taskmgr.CloseMainWindow() +} +$taskmgr = Start-Process -FilePath taskmgr.exe -WindowStyle Hidden -PassThru +Do +{ + Start-Sleep -Milliseconds 100 + $preferences = Get-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager -Name Preferences -ErrorAction SilentlyContinue +} +Until ($preferences) +Stop-Process -Name $taskmgr +$preferences.Preferences[28] = 0 +New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager -Name Preferences -PropertyType Binary -Value $preferences.Preferences -Force +# Do not allow the computer to turn off the device to save power for desktop +IF ((Get-CimInstance -ClassName Win32_ComputerSystem).PCSystemType -eq 1) +{ + $adapter = Get-NetAdapter -Physical | Get-NetAdapterPowerManagement + $adapter.AllowComputerToTurnOffDevice = "Disabled" + $adapter | Set-NetAdapterPowerManagement +} + +# Add "Install" to CAB file type context menu +IF (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs\Command)) +{ + New-Item -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs\Command -Force +} +New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs\Command -Name "(default)" -PropertyType String -Value "cmd /c DISM /Online /Add-Package /PackagePath:`"%1`" /NoRestart & pause" -Force +New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs -Name MUIVerb -PropertyType String -Value "@shell32.dll,-10210" -Force +New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs -Name HasLUAShield -PropertyType String -Value "" -Force +# Remove "Cast to Device" from context menu +IF (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked")) +{ + New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Force +} +New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -PropertyType String -Value "Play to menu" -Force +# Remove "Share" from context menu +IF (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked")) +{ + New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Force +} +New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -PropertyType String -Value "" -Force +# Remove "Previous Versions" from file context menu +IF (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked")) +{ + New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Force +} +New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{596AB062-B4D2-4215-9F74-E9109B0A8153}" -PropertyType String -Value "" -Force +# Remove "Edit with Paint 3D" from context menu +$exts = @(".bmp", ".gif", ".jpe", ".jpeg", ".jpg", ".png", ".tif", ".tiff") +foreach ($ext in $exts) +{ + New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\$ext\Shell\3D Edit" -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force +} +# Remove "Include in Library" from context menu +New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers\Library Location" -Name "(default)" -PropertyType String -Value "-{3dad6c5d-2167-4cae-9914-f99e41c12cfa}" -Force +# Remove "Turn on BitLocker" from context menu +IF (Get-WindowsEdition -Online | Where-Object -FilterScript {$_.Edition -eq "Professional" -or $_.Edition -eq "Enterprise"}) +{ + New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\encrypt-bde -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force + New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\encrypt-bde-elev -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force + New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\manage-bde -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force + New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\resume-bde -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force + New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\resume-bde-elev -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force + New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\unlock-bde -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force +} + +# Turn off per-user services +$services = @( + # Contact Data + "PimIndexMaintenanceSvc_*", + # User Data Storage + "UnistoreSvc_*", + # User Data Access + "UserDataSvc_*" +) +Get-Service -Name $services | Stop-Service -Force +New-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\PimIndexMaintenanceSvc -Name Start -Value 4 -Force +New-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\PimIndexMaintenanceSvc -Name UserServiceFlags -Value 0 -Force +New-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\UnistoreSvc -Name Start -Value 4 -Force +New-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\UnistoreSvc -Name UserServiceFlags -Value 0 -Force +New-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\UserDataSvc -Name Start -Value 4 -Force +New-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\UserDataSvc -Name ServiceFlags -Value 0 -Force + +# Remove printers +Remove-Printer -Name Fax, "Microsoft XPS Document Writer", "Microsoft Print to PDF" -ErrorAction SilentlyContinue +# Hide notification about sign in with Microsoft in the Windows Security +New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Security Health\State" -Name AccountProtection_MicrosoftAccount_Disconnected -Value 1 -Force +# Hide notification about disabled Smartscreen for Microsoft Edge +New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Security Health\State" -Name AppAndBrowser_EdgeSmartScreenOff -Value 0 -Force +# Remove Windows capabilities +$IncludedApps = @( + # Microsoft Quick Assist + "App.Support.QuickAssist*" + # Windows Hello Face + "Hello.Face*" + # Windows Media Player + "Media.WindowsMediaPlayer*" +) +$OFS = "|" +Get-WindowsCapability -Online | Where-Object -FilterScript {$_.Name -cmatch $IncludedApps} | Remove-WindowsCapability -Online +$OFS = " " + +# Turn on Windows Defender Sandbox +[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +setx /M MP_FORCE_USE_SANDBOX 1 + +# Remove "$env:SystemDrive\PerfLogs" +Remove-Item $env:SystemDrive\PerfLogs -Recurse -Force -ErrorAction SilentlyContinue +# Remove "$env:LOCALAPPDATA\Temp" +Remove-Item $env:LOCALAPPDATA\Temp -Recurse -Force -ErrorAction SilentlyContinue +# Remove "$env:SYSTEMROOT\Temp" +Restart-Service -Name Spooler -Force +Remove-Item -Path "$env:SystemRoot\Temp" -Recurse -Force -ErrorAction SilentlyContinue + +# Turn on automatic backup the system registry to the "$env:SystemRoot\System32\config\RegBack" folder +New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -Value 1 -Force + +# Turn off reserved storage +New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager -Name BaseHardReserveSize -PropertyType QWord -Value 0 -Force +New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager -Name BaseSoftReserveSize -PropertyType QWord -Value 0 -Force +New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager -Name HardReserveAdjustment -PropertyType QWord -Value 0 -Force +New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager -Name MinDiskSize -PropertyType QWord -Value 0 -Force +New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager -Name ShippedWithReserves -Value 0 -Force \ No newline at end of file diff --git a/Individual Scripts/mouse-fix.reg b/Individual Scripts/mouse-fix.reg new file mode 100644 index 00000000..31d1faad --- /dev/null +++ b/Individual Scripts/mouse-fix.reg @@ -0,0 +1,9 @@ +Windows Registry Editor Version 5.00 + +; should fix any mouse delay and remove acceleration ~ lisa / princessakira + +[HKEY_CURRENT_USER\Control Panel\Mouse] +"SmoothMouseXCurve"=hex:00,00,00,00,00,00,00,00,00,a0,00,00,00,00,00,00,00,40,\ + 01,00,00,00,00,00,00,80,02,00,00,00,00,00,00,00,05,00,00,00,00,00 +"SmoothMouseYCurve"=hex:00,00,00,00,00,00,00,00,66,a6,02,00,00,00,00,00,cd,4c,\ + 05,00,00,00,00,00,a0,99,0a,00,00,00,00,00,38,33,15,00,00,00,00,00 \ No newline at end of file diff --git a/win10debloat.ps1 b/win10debloat.ps1 index ee7ba638..82c32228 100644 --- a/win10debloat.ps1 +++ b/win10debloat.ps1 @@ -5,31 +5,17 @@ $ErrorActionPreference = 'SilentlyContinue' $wshell = New-Object -ComObject Wscript.Shell $Button = [System.Windows.MessageBoxButton]::YesNoCancel $ErrorIco = [System.Windows.MessageBoxImage]::Error -$Ask = 'Do you want to run this as an Administrator? - Select "Yes" to Run as an Administrator - Select "No" to not run this as an Administrator - - Select "Cancel" to stop the script.' - If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]'Administrator')) { - $Prompt = [System.Windows.MessageBox]::Show($Ask, "Run as an Administrator or not?", $Button, $ErrorIco) - Switch ($Prompt) { - #This will debloat Windows 10 - Yes { - Write-Host "You didn't run this script as an Administrator. This script will self elevate to run as an Administrator and continue." - Start-Process PowerShell.exe -ArgumentList ("-NoProfile -ExecutionPolicy Bypass -File `"{0}`"" -f $PSCommandPath) -Verb RunAs - Exit - } - No { - Break - } - } + Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs + Exit } # GUI Specs Write-Host "Checking winget..." Try{ + # Im just gonna sneak this in here bc why not lmao + New-Item -ItemType directory -Path "$PSScriptRoot/dump" # Check if winget is already installed $er = (invoke-expression "winget -v") 2>&1 if ($lastexitcode) {throw $er} @@ -38,20 +24,19 @@ Try{ Catch{ # winget is not installed. Install it from the Github release Write-Host "winget is not found, installing it right now." - $download = "https://github.com/microsoft/winget-cli/releases/download/v1.0.11692/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" - $output = $PSScriptRoot + "\winget-latest.appxbundle" + $output = "$PSScriptRoot/dump/" + "winget-latest.appxbundle" Write-Host "Dowloading latest release" Invoke-WebRequest -Uri $download -OutFile $output - Write-Host "Installing the package" Add-AppxPackage -Path $output } Finally { # Start installing the packages with winget - #Get-Content .\winget.txt | ForEach-Object { + # Get-Content .\winget.txt | ForEach-Object { # iex ("winget install -e " + $_) - #} + # } + # Create the App Dump Folder } $Form = New-Object system.Windows.Forms.Form @@ -76,223 +61,140 @@ $Form.Icon = [System.Drawing.Icon]::FromHandle((New-Object Sy $Form.Width = $objImage.Width $Form.Height = $objImage.Height -$Panel1 = New-Object system.Windows.Forms.Panel -$Panel1.height = 639 -$Panel1.width = 219 -$Panel1.location = New-Object System.Drawing.Point(6,54) - -$brave = New-Object system.Windows.Forms.Button -$brave.text = "Brave Browser" -$brave.width = 212 -$brave.height = 30 -$brave.location = New-Object System.Drawing.Point(3,94) -$brave.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$firefox = New-Object system.Windows.Forms.Button -$firefox.text = "Firefox" -$firefox.width = 212 -$firefox.height = 30 -$firefox.location = New-Object System.Drawing.Point(4,127) -$firefox.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$7zip = New-Object system.Windows.Forms.Button -$7zip.text = "7-Zip" -$7zip.width = 211 -$7zip.height = 30 -$7zip.location = New-Object System.Drawing.Point(4,363) -$7zip.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$irfanview = New-Object system.Windows.Forms.Button -$irfanview.text = "Irfanview (Image Viewer)" -$irfanview.width = 212 -$irfanview.height = 30 -$irfanview.location = New-Object System.Drawing.Point(3,195) -$irfanview.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$adobereader = New-Object system.Windows.Forms.Button -$adobereader.text = "Adobe Reader DC" -$adobereader.width = 212 -$adobereader.height = 30 -$adobereader.location = New-Object System.Drawing.Point(4,528) -$adobereader.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$notepad = New-Object system.Windows.Forms.Button -$notepad.text = "Notepad++" -$notepad.width = 212 -$notepad.height = 30 -$notepad.location = New-Object System.Drawing.Point(4,461) -$notepad.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$gchrome = New-Object system.Windows.Forms.Button -$gchrome.text = "Google Chrome" -$gchrome.width = 212 -$gchrome.height = 30 -$gchrome.location = New-Object System.Drawing.Point(4,161) -$gchrome.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$mpc = New-Object system.Windows.Forms.Button -$mpc.text = "Media Player Classic" -$mpc.width = 211 -$mpc.height = 30 -$mpc.location = New-Object System.Drawing.Point(4,329) -$mpc.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$vlc = New-Object system.Windows.Forms.Button -$vlc.text = "VLC" -$vlc.width = 212 -$vlc.height = 30 -$vlc.location = New-Object System.Drawing.Point(4,296) -$vlc.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$powertoys = New-Object system.Windows.Forms.Button -$powertoys.text = "PowerToys" -$powertoys.width = 211 -$powertoys.height = 30 -$powertoys.location = New-Object System.Drawing.Point(4,60) -$powertoys.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$winterminal = New-Object system.Windows.Forms.Button -$winterminal.text = "Windows Terminal" -$winterminal.width = 211 -$winterminal.height = 30 -$winterminal.location = New-Object System.Drawing.Point(4,26) -$winterminal.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$vscode = New-Object system.Windows.Forms.Button -$vscode.text = "VS Code" -$vscode.width = 211 -$vscode.height = 30 -$vscode.location = New-Object System.Drawing.Point(4,396) -$vscode.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$Label2 = New-Object system.Windows.Forms.Label -$Label2.text = "(Windows 1809+ Required)" -$Label2.AutoSize = $true -$Label2.width = 25 -$Label2.height = 10 -$Label2.location = New-Object System.Drawing.Point(26,5) -$Label2.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10) - -$Panel2 = New-Object system.Windows.Forms.Panel -$Panel2.height = 386 -$Panel2.width = 211 -$Panel2.location = New-Object System.Drawing.Point(239,54) - -$Label3 = New-Object system.Windows.Forms.Label -$Label3.text = "System Tweaks" -$Label3.AutoSize = $true -$Label3.width = 230 -$Label3.height = 25 -$Label3.location = New-Object System.Drawing.Point(230,12) -$Label3.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',24) - -$essentialtweaks = New-Object system.Windows.Forms.Button -$essentialtweaks.text = "Essential Tweaks" -$essentialtweaks.width = 204 -$essentialtweaks.height = 75 -$essentialtweaks.location = New-Object System.Drawing.Point(4,25) -$essentialtweaks.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',14) - -$backgroundapps = New-Object system.Windows.Forms.Button -$backgroundapps.text = "Disable Background Apps" -$backgroundapps.width = 205 -$backgroundapps.height = 30 -$backgroundapps.location = New-Object System.Drawing.Point(3,139) -$backgroundapps.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$cortana = New-Object system.Windows.Forms.Button -$cortana.text = "Disable Cortana (Search)" -$cortana.width = 204 -$cortana.height = 30 -$cortana.location = New-Object System.Drawing.Point(4,174) -$cortana.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$actioncenter = New-Object system.Windows.Forms.Button -$actioncenter.text = "Disable Action Center" -$actioncenter.width = 203 -$actioncenter.height = 30 -$actioncenter.location = New-Object System.Drawing.Point(4,105) -$actioncenter.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$darkmode = New-Object system.Windows.Forms.Button -$darkmode.text = "Dark Mode" -$darkmode.width = 204 -$darkmode.height = 30 -$darkmode.location = New-Object System.Drawing.Point(4,244) -$darkmode.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$visualfx = New-Object system.Windows.Forms.Button -$visualfx.text = "Basic Visual FX" -$visualfx.width = 204 -$visualfx.height = 30 -$visualfx.location = New-Object System.Drawing.Point(4,313) -$visualfx.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$onedrive = New-Object system.Windows.Forms.Button -$onedrive.text = "Uninstall OneDrive" -$onedrive.width = 204 -$onedrive.height = 30 -$onedrive.location = New-Object System.Drawing.Point(4,209) -$onedrive.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$Label15 = New-Object system.Windows.Forms.Label -$Label15.text = "Windows Update" -$Label15.AutoSize = $true -$Label15.width = 25 -$Label15.height = 10 -$Label15.location = New-Object System.Drawing.Point(739,11) -$Label15.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',24) - -$Panel4 = New-Object system.Windows.Forms.Panel -$Panel4.height = 179 -$Panel4.width = 340 -$Panel4.location = New-Object System.Drawing.Point(699,55) - -$defaultwindowsupdate = New-Object system.Windows.Forms.Button -$defaultwindowsupdate.text = "Default Settings" -$defaultwindowsupdate.width = 300 -$defaultwindowsupdate.height = 30 -$defaultwindowsupdate.location = New-Object System.Drawing.Point(24,26) -$defaultwindowsupdate.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',14) - -$securitywindowsupdate = New-Object system.Windows.Forms.Button -$securitywindowsupdate.text = "Security Updates Only" -$securitywindowsupdate.width = 300 -$securitywindowsupdate.height = 30 -$securitywindowsupdate.location = New-Object System.Drawing.Point(24,142) -$securitywindowsupdate.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',14) - -$Label16 = New-Object system.Windows.Forms.Label -$Label16.text = "I recommend doing security updates only." -$Label16.AutoSize = $true -$Label16.width = 25 -$Label16.height = 10 -$Label16.location = New-Object System.Drawing.Point(62,65) -$Label16.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10) - -$Label17 = New-Object system.Windows.Forms.Label -$Label17.text = "- Delays Features updates up to 3 years" -$Label17.AutoSize = $true -$Label17.width = 25 -$Label17.height = 10 -$Label17.location = New-Object System.Drawing.Point(63,84) -$Label17.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10) - -$Label18 = New-Object system.Windows.Forms.Label -$Label18.text = "- Delays Security updates 4 days" -$Label18.AutoSize = $true -$Label18.width = 25 -$Label18.height = 10 -$Label18.location = New-Object System.Drawing.Point(63,105) -$Label18.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10) - -$Label19 = New-Object system.Windows.Forms.Label -$Label19.text = "- Sets Maximum Active Time" -$Label19.AutoSize = $true -$Label19.width = 25 -$Label19.height = 10 -$Label19.location = New-Object System.Drawing.Point(63,126) -$Label19.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10) +$MSSansSerif = "Microsoft Sans Serif" + +function Create-Panel { + param ( + [int] $Height, + [int] $Width, + [int] $LocationX, + [int] $LocationY + ) + + $Pnl = New-Object System.Windows.Forms.Panel + $location = New-Object System.Drawing.Point($LocationX, $LocationY) + + $Pnl.Height = $Height + $Pnl.Width = $Width + $Pnl.Location = $location + return $Pnl +} + +function Create-Button { + param ( + [string] $Text, + [int] $Width, + [int] $Height, + [int] $LocationX, + [int] $LocationY, + [string] $FontName, + [int] $FontSize + ) + + $location = New-Object System.Drawing.Point($LocationX, $LocationY) + $font = New-Object System.Drawing.Font($FontName, $FontSize) + + $Btn = New-Object System.Windows.Forms.Button + $Btn.Text = $Text + $Btn.Width = $Width + $Btn.Height = $Height + $Btn.Location = $location + $Btn.Font = $font + return $Btn +} + +function Create-Label { + param ( + [string] $Text, + [bool] $AutoSize, + [int] $Width, + [int] $Height, + [int] $LocationX, + [int] $LocationY, + [string] $FontName, + [int] $FontSize + ) + + $location = New-Object System.Drawing.Point($LocationX, $LocationY) + $font = New-Object System.Drawing.Font($FontName, $FontSize) + + $Lbl = New-Object System.Windows.Forms.Label + $Lbl.Text = $Text + $Lbl.AutoSize = $AutoSize + $Lbl.Width = $Width + $Lbl.Height = $Height + $Lbl.Location = $location + $Lbl.Font = $font + return $Lbl +} + +# Panels +$Panel1 = Create-Panel -Height 800 -Width 219 -LocationX 6 -LocationY 54 +$Panel2 = Create-Panel -Height 386 -Width 211 -LocationX 239 -LocationY 54 +$Panel3 = Create-Panel -Height 387 -Width 220 -LocationX 464 -LocationY 54 +$Panel4 = Create-Panel -Height 179 -Width 340 -LocationX 699 -LocationY 55 + +# Labels +$Label1 = Create-Label -Text "Install" -AutoSize $True -Width 230 -Height 25 -LocationX 76 -LocationY 11 -FontName $MSSansSerif -FontSize 24 +$Label2 = Create-Label -Text "(Windows 1809+ Required)" -AutoSize $True -Width 25 -Height 10 -LocationX 26 -LocationY 5 -FontName $MSSansSerif -FontSize 10 +$Label3 = Create-Label -Text "System Tweaks" -AutoSize $True -Width 230 -Height 25 -LocationX 230 -LocationY 12 -FontName $MSSansSerif -FontSize 24 +$Label4 = Create-Label -Text "Undo" -AutoSize $True -Width 230 -Height 25 -LocationX 534 -LocationY 12 -FontName $MSSansSerif -FontSize 24 +$Label15 = Create-Label -Text "Windows Update" -AutoSize $True -Width 25 -Height 10 -LocationX 739 -LocationY 11 -FontName $MSSansSerif -FontSize 24 +$Label16 = Create-Label -Text "I recommend doing security updates only" -AutoSize $True -Width 25 -Height 10 -LocationX 62 -LocationY 65 -FontName $MSSansSerif -FontSize 10 +$Label17 = Create-Label -Text "- Delays Features updates up to 3 years" -AutoSize $True -Width 25 -Height 10 -LocationX 63 -LocationY 84 -FontName $MSSansSerif -FontSize 10 +$Label18 = Create-Label -Text "- Delays security updates 4 days" -AutoSize $True -Width 25 -Height 10 -LocationX 63 -LocationY 105 -FontName $MSSansSerif -FontSize 10 +$Label19 = Create-Label -Text "- Sets Maximum Active Time" -AutoSize $True -Width 25 -Height 10 -LocationX 63 -LocationY 126 -FontName $MSSansSerif -FontSize 10 + +# Install Buttons (In order of appearance) +$winterminal = Create-Button -Text "Windows Terminal" -Width 211 -Height 30 -LocationX 4 -LocationY 26 -FontName $MSSansSerif -FontSize 12 +$powertoys = Create-Button -Text "PowerToys" -Width 211 -Height 30 -LocationX 4 -LocationY 60 -FontName $MSSansSerif -FontSize 12 +$brave = Create-Button -Text "Brave Browser" -Width 212 -Height 30 -LocationX 3 -LocationY 94 -FontName $MSSansSerif -FontSize 12 +$firefox = Create-Button -Text "Firefox" -Width 212 -Height 30 -LocationX 4 -LocationY 127 -FontName $MSSansSerif -FontSize 12 +$gchrome = Create-Button -Text "Google Chrome" -Width 211 -Height 30 -LocationX 4 -LocationY 161 -FontName $MSSansSerif -FontSize 12 +$irfanview = Create-Button -Text "Irfanview (Image Viewer)" -Width 212 -Height 30 -LocationX 3 -LocationY 195 -FontName $MSSansSerif -FontSize 12 +$imageglass = Create-Button -Text "ImageGlass (Image Viewer)" -Width 212 -Height 30 -LocationX 4 -LocationY 228 -FontName $MSSansSerif -FontSize 12 +$honeyview = Create-Button -Text "HoneyView (Image Viewer)" -Width 212 -Height 30 -LocationX 4 -LocationY 261 -FontName $MSSansSerif -FontSize 12 +$vlc = Create-Button -Text "VLC" -Width 212 -Height 30 -LocationX 4 -LocationY 296 -FontName $MSSansSerif -FontSize 12 +$mpc = Create-Button -Text "Media Player Classic" -Width 211 -Height 30 -LocationX 4 -LocationY 329 -FontName $MSSansSerif -FontSize 12 +$7zip = Create-Button -Text "7-Zip" -Width 211 -Height 30 -LocationX 4 -LocationY 363 -FontName $MSSansSerif -FontSize 12 +$vscode = Create-Button -Text "VS Code" -Width 211 -Height 30 -LocationX 4 -LocationY 396 -FontName $MSSansSerif -FontSize 12 +$vscodium = Create-Button -Text "VS Codium" -Width 211 -Height 30 -LocationX 4 -LocationY 429 -FontName $MSSansSerif -FontSize 12 +$notepad = Create-Button -Text "Notepad++" -Width 211 -Height 30 -LocationX 4 -LocationY 461 -FontName $MSSansSerif -FontSize 12 +$everythingsearch = Create-Button -Text "Everything Search" -Width 211 -Height 30 -LocationX 4 -LocationY 495 -FontName $MSSansSerif -FontSize 12 +$adobereader = Create-Button -Text "Adobe Reader DC" -Width 212 -Height 30 -LocationX 4 -LocationY 528 -FontName $MSSansSerif -FontSize 12 +$sumatrapdf = Create-Button -Text "Sumatra PDF" -Width 212 -Height 30 -LocationX 3 -LocationY 561 -FontName $MSSansSerif -FontSize 12 +$nvcleanstall = Create-Button -Text "NVCleanstall" -Width 212 -Height 30 -LocationX 4 -LocationY 592 -FontName $MSSansSerif -FontSize 12 +$sdi = Create-Button -Text "SnappyDriverInstaller" -Width 212 -Height 30 -LocationX 4 -LocationY 621 -FontName $MSSansSerif -FontSize 12 + +# System Tweak Buttons (In order of appearance) +$essentialtweaks = Create-Button -Text "Essential Tweaks" -Width 204 -Height 75 -LocationX 4 -LocationY 25 -FontName $MSSansSerif -FontSize 14 +$actioncenter = Create-Button -Text "Disable Action Center" -Width 203 -Height 30 -LocationX 4 -LocationY 105 -FontName $MSSansSerif -FontSize 12 +$backgroundapps = Create-Button -Text "Disable Background Apps" -Width 205 -Height 30 -LocationX 3 -LocationY 139 -FontName $MSSansSerif -FontSize 12 +$cortana = Create-Button -Text "Disable Cortana (Search)" -Width 204 -Height 30 -LocationX 4 -LocationY 174 -FontName $MSSansSerif -FontSize 12 +$onedrive = Create-Button -Text "Uninstall OneDrive" -Width 204 -Height 30 -LocationX 4 -LocationY 209 -FontName $MSSansSerif -FontSize 12 +$darkmode = Create-Button -Text "Dark mode" -Width 204 -Height 30 -LocationX 4 -LocationY 244 -FontName $MSSansSerif -FontSize 12 +$lightmode = Create-Button -Text "Light Mode" -Width 204 -Height 30 -LocationX 4 -LocationY 279 -FontName $MSSansSerif -FontSize 12 +$visualfx = Create-Button -Text "Basic Visual FX" -Width 204 -Height 30 -LocationX 4 -LocationY 313 -FontName $MSSansSerif -FontSize 12 + +# Undo Buttons (In order of appearance) +$essentialundo = Create-Button -Text "Undo All" -Width 211 -Height 75 -LocationX 4 -LocationY 25 -FontName $MSSansSerif -FontSize 14 +$EActionCenter = Create-Button -Text "Enable Action Center" -Width 211 -Height 30 -LocationX 4 -LocationY 105 -FontName $MSSansSerif -FontSize 12 +$RBackgroundApps = Create-Button -Text "Allow Background Apps" -Width 212 -Height 30 -LocationX 4 -LocationY 139 -FontName $MSSansSerif -FontSize 12 +$ECortana = Create-Button -Text "Enable Cortana (Search)" -Width 212 -Height 30 -LocationX 4 -LocationY 173 -FontName $MSSansSerif -FontSize 12 +$InstallOneDrive = Create-Button -Text "Install OneDrive" -Width 212 -Height 30 -LocationX 4 -LocationY 208 -FontName $MSSansSerif -FontSize 12 +$HTrayIcons = Create-Button -Text "Hide Tray Icons" -Width 212 -Height 30 -LocationX 4 -LocationY 242 -FontName $MSSansSerif -FontSize 12 +$EClipboardHistory = Create-Button -Text "Enable Clipboard History" -Width 212 -Height 30 -LocationX 4 -LocationY 276 -FontName $MSSansSerif -FontSize 12 +$ELocation = Create-Button -Text "Enable Location Tracking" -Width 211 -Height 30 -LocationX 4 -LocationY 310 -FontName $MSSansSerif -FontSize 12 +$yourphonefix = Create-Button -Text "Your Phone App Fix" -Width 211 -Height 30 -LocationX 4 -LocationY 344 -FontName $MSSansSerif -FontSize 12 + +# Windows Update Buttons (In order of appearance) +$defaultwindowsupdate = Create-Button -Text "Default Settings" -Width 300 -Height 30 -LocationX 24 -LocationY 26 -FontName $MSSansSerif -FontSize 14 +$securitywindowsupdate = Create-Button -Text "Security Updates Only" -Width 300 -Height 30 -LocationX 24 -LocationY 142 -FontName $MSSansSerif -FontSize 14 + + + + + $PictureBox1 = New-Object system.Windows.Forms.PictureBox $PictureBox1.width = 412 @@ -300,134 +202,13 @@ $PictureBox1.height = 125 $PictureBox1.location = New-Object System.Drawing.Point(247,500) $PictureBox1.imageLocation = "https://github.com/ChrisTitusTech/win10script/blob/master/titus-toolbox.png?raw=true" $PictureBox1.SizeMode = [System.Windows.Forms.PictureBoxSizeMode]::zoom -$lightmode = New-Object system.Windows.Forms.Button -$lightmode.text = "Light Mode" -$lightmode.width = 204 -$lightmode.height = 30 -$lightmode.location = New-Object System.Drawing.Point(4,279) -$lightmode.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$Label1 = New-Object system.Windows.Forms.Label -$Label1.text = "Install" -$Label1.AutoSize = $true -$Label1.width = 230 -$Label1.height = 25 -$Label1.location = New-Object System.Drawing.Point(76,11) -$Label1.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',24) - -$Label4 = New-Object system.Windows.Forms.Label -$Label4.text = "Undo" -$Label4.AutoSize = $true -$Label4.width = 230 -$Label4.height = 25 -$Label4.location = New-Object System.Drawing.Point(534,12) -$Label4.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',24) - -$Panel3 = New-Object system.Windows.Forms.Panel -$Panel3.height = 387 -$Panel3.width = 220 -$Panel3.location = New-Object System.Drawing.Point(464,54) - -$essentialundo = New-Object system.Windows.Forms.Button -$essentialundo.text = "Undo All" -$essentialundo.width = 211 -$essentialundo.height = 75 -$essentialundo.location = New-Object System.Drawing.Point(4,25) -$essentialundo.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',14) - -$EActionCenter = New-Object system.Windows.Forms.Button -$EActionCenter.text = "Enable Action Center" -$EActionCenter.width = 211 -$EActionCenter.height = 30 -$EActionCenter.location = New-Object System.Drawing.Point(4,105) -$EActionCenter.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$ECortana = New-Object system.Windows.Forms.Button -$ECortana.text = "Enable Cortana (Search)" -$ECortana.width = 212 -$ECortana.height = 30 -$ECortana.location = New-Object System.Drawing.Point(4,173) -$ECortana.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$RBackgroundApps = New-Object system.Windows.Forms.Button -$RBackgroundApps.text = "Allow Background Apps" -$RBackgroundApps.width = 212 -$RBackgroundApps.height = 30 -$RBackgroundApps.location = New-Object System.Drawing.Point(4,139) -$RBackgroundApps.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$HTrayIcons = New-Object system.Windows.Forms.Button -$HTrayIcons.text = "Hide Tray Icons" -$HTrayIcons.width = 212 -$HTrayIcons.height = 30 -$HTrayIcons.location = New-Object System.Drawing.Point(4,242) -$HTrayIcons.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$EClipboardHistory = New-Object system.Windows.Forms.Button -$EClipboardHistory.text = "Enable Clipboard History" -$EClipboardHistory.width = 212 -$EClipboardHistory.height = 30 -$EClipboardHistory.location = New-Object System.Drawing.Point(4,276) -$EClipboardHistory.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$ELocation = New-Object system.Windows.Forms.Button -$ELocation.text = "Enable Location Tracking" -$ELocation.width = 211 -$ELocation.height = 30 -$ELocation.location = New-Object System.Drawing.Point(4,310) -$ELocation.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$InstallOneDrive = New-Object system.Windows.Forms.Button -$InstallOneDrive.text = "Install OneDrive" -$InstallOneDrive.width = 212 -$InstallOneDrive.height = 30 -$InstallOneDrive.location = New-Object System.Drawing.Point(4,208) -$InstallOneDrive.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$everythingsearch = New-Object system.Windows.Forms.Button -$everythingsearch.text = "Everything Search" -$everythingsearch.width = 211 -$everythingsearch.height = 30 -$everythingsearch.location = New-Object System.Drawing.Point(4,495) -$everythingsearch.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$sumatrapdf = New-Object system.Windows.Forms.Button -$sumatrapdf.text = "Sumatra PDF" -$sumatrapdf.width = 212 -$sumatrapdf.height = 30 -$sumatrapdf.location = New-Object System.Drawing.Point(3,561) -$sumatrapdf.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$vscodium = New-Object system.Windows.Forms.Button -$vscodium.text = "VS Codium" -$vscodium.width = 211 -$vscodium.height = 30 -$vscodium.location = New-Object System.Drawing.Point(4,429) -$vscodium.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$imageglass = New-Object system.Windows.Forms.Button -$imageglass.text = "ImageGlass (Image Viewer)" -$imageglass.width = 212 -$imageglass.height = 30 -$imageglass.location = New-Object System.Drawing.Point(4,228) -$imageglass.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$honeyview = New-Object system.Windows.Forms.Button -$honeyview.text = "Honeyview (Image Viewer)" -$honeyview.width = 212 -$honeyview.height = 30 -$honeyview.location = New-Object System.Drawing.Point(4,261) -$honeyview.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) - -$yourphonefix = New-Object system.Windows.Forms.Button -$yourphonefix.text = "Your Phone App Fix" -$yourphonefix.width = 211 -$yourphonefix.height = 30 -$yourphonefix.location = New-Object System.Drawing.Point(4,344) -$yourphonefix.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12) + + + + $Form.controls.AddRange(@($Panel1,$Panel2,$Label3,$Label15,$Panel4,$PictureBox1,$Label1,$Label4,$Panel3)) -$Panel1.controls.AddRange(@($brave,$firefox,$7zip,$irfanview,$adobereader,$notepad,$gchrome,$mpc,$vlc,$powertoys,$winterminal,$vscode,$Label2,$everythingsearch,$sumatrapdf,$vscodium,$imageglass,$honeyview)) +$Panel1.controls.AddRange(@($brave,$firefox,$7zip,$irfanview,$adobereader,$notepad,$gchrome,$mpc,$vlc,$powertoys,$winterminal,$vscode,$Label2,$everythingsearch,$sumatrapdf,$vscodium,$imageglass,$honeyview,$nvcleanstall,$sdi)) $Panel2.controls.AddRange(@($essentialtweaks,$backgroundapps,$cortana,$actioncenter,$darkmode,$visualfx,$onedrive,$lightmode)) $Panel4.controls.AddRange(@($defaultwindowsupdate,$securitywindowsupdate,$Label16,$Label17,$Label18,$Label19)) $Panel3.controls.AddRange(@($essentialundo,$EActionCenter,$ECortana,$RBackgroundApps,$HTrayIcons,$EClipboardHistory,$ELocation,$InstallOneDrive,$yourphonefix)) @@ -435,113 +216,133 @@ $Panel3.controls.AddRange(@($essentialundo,$EActionCenter,$ECortana,$RBackground $brave.Add_Click({ Write-Host "Installing Brave Browser" winget install BraveSoftware.BraveBrowser | Out-Host - Write-Host "Installed Brave Browser" + if($?) { Write-Host "Installed Brave Browser" } }) $firefox.Add_Click({ Write-Host "Installing Firefox" winget install Mozilla.Firefox | Out-Host - Write-Host "Installed Firefox" + if($?) { Write-Host "Installed Firefox" } }) $gchrome.Add_Click({ Write-Host "Installing Google Chrome" winget install Google.Chrome | Out-Host - Write-Host "Installed Google Chrome" + if($?) { Write-Host "Installed Google Chrome" } }) $irfanview.Add_Click({ Write-Host "Installing Irfanview (Image Viewer)" winget install IrfanSkiljan.IrfanView | Out-Host - Write-Host "Installed Irfanview (Image Viewer)" + if($?) { Write-Host "Installed Irfanview (Image Viewer)" } }) $imageglass.Add_Click({ Write-Host "Installing Image Glass (Image Viewer)" winget install DuongDieuPhap.ImageGlass | Out-Host - Write-Host "Installed Image Glass (Image Viewer)" + if($?) { Write-Host "Installed Image Glass (Image Viewer)" } }) $honeyview.Add_Click({ Write-Host "Installing Bandisoft Honeyview (Image Viewer)" winget install Bandisoft.Honeyview | Out-Host - Write-Host "Installed Honeyview (Image Viewer)" + if($?) { Write-Host "Installed Honeyview (Image Viewer)" } }) $adobereader.Add_Click({ Write-Host "Installing Adobe Reader DC" winget install Adobe.AdobeAcrobatReaderDC | Out-Host - Write-Host "Installed Adobe Reader DC" + if($?) { Write-Host "Installed Adobe Reader DC" } }) $notepad.Add_Click({ Write-Host "Installing Notepad++" winget install Notepad++.Notepad++ | Out-Host - Write-Host "Installed Notepad++" + if($?) { Write-Host "Installed Notepad++" } }) $vlc.Add_Click({ Write-Host "Installing VLC Media Player" winget install VideoLAN.VLC | Out-Host - Write-Host "Installed VLC Media Player" + if($?) { Write-Host "Installed VLC Media Player" } }) $mpc.Add_Click({ Write-Host "Installing Media Player Classic" winget install clsid2.mpc-hc | Out-Host - Write-Host "Installed Media Player Classic" + if($?) { Write-Host "Installed Media Player Classic" } }) $7zip.Add_Click({ Write-Host "Installing 7-Zip Compression Tool" winget install 7zip.7zip | Out-Host - Write-Host "Installed 7-Zip Compression Tool" + if($?) { Write-Host "Installed 7-Zip Compression Tool" } }) $vscode.Add_Click({ Write-Host "Installing Visual Studio Code" winget install Microsoft.VisualStudioCode | Out-Host - Write-Host "Installed Visual Studio Code" + if($?) { Write-Host "Installed Visual Studio Code" } }) $vscodium.Add_Click({ Write-Host "Installing VS Codium" - winget install Microsoft.VSCodium.VSCodium | Out-Host - Write-Host "Installed VS Codium" + winget install VSCodium.VSCodium | Out-Host + if($?) { Write-Host "Installed VS Codium" } }) $winterminal.Add_Click({ Write-Host "Installing New Windows Terminal" winget install Microsoft.WindowsTerminal | Out-Host - Write-Host "Installed New Windows Terminal" + if($?) { Write-Host "Installed New Windows Terminal" } }) $powertoys.Add_Click({ Write-Host "Installing Microsoft PowerToys" winget install Microsoft.PowerToys | Out-Host - Write-Host "Installed Microsoft PowerToys" + if($?) { Write-Host "Installed Microsoft PowerToys" } }) $everythingsearch.Add_Click({ Write-Host "Installing Voidtools Everything Search" winget install voidtools.Everything | Out-Host - Write-Host "Installed Everything Search" + if($?) { Write-Host "Installed Everything Search" } }) $sumatrapdf.Add_Click({ Write-Host "Installing Sumatra PDF" winget install SumatraPDF.SumatraPDF | Out-Host - Write-Host "Installed Sumatra PDF" + if($?) { Write-Host "Installed Sumatra PDF" } +}) + +$nvcleanstall.Add_Click({ + Write-Host "Download NVCleanstall for NvidiaDrivers" + # Put the URL on my own Upload Server, since NVCleanstall is hosted via Techpowerup and they dont have Permalinks + $url = "https://files.thicc-thighs.de/?r=/download&path=L1NjcmlwdHMvTnZDbGVhbnN0YWxsLmV4ZQ%3D%3D" + $output = "$PSScriptRoot/dump/NVCleanstall_1.10.0.exe" + Invoke-WebRequest -Uri $url -OutFile $output + Start-Process -FilePath $output }) +$sdi.Add_Click({ + Write-Host "Downloading SnappyDriverInstaller" + $url = "https://sdi-tool.org/releases/SDI_R2102.zip" + $output = "$PSScriptRoot/dump/sdi.zip" + New-Item -ItemType directory -Path "$PSScriptRoot/dump/sdi" + Invoke-WebRequest -Uri $url -OutFile $output + Expand-Archive "$PSScriptRoot/dump/sdi.zip" -DestinationPath "$PSScriptRoot/dump/sdi" + Start "$PSScriptRoot/dump/sdi" +}) +$openshell.Add_Click({ + Write-Host "Installing OpenShell (Old Windows menu)" + winget install openshellmenu | Out-Host + Write-Host "Installed OpenShell" +}) $essentialtweaks.Add_Click({ Write-Host "Creating Restore Point incase something bad happens" Enable-ComputerRestore -Drive "C:\" Checkpoint-Computer -Description "RestorePoint1" -RestorePointType "MODIFY_SETTINGS" - Write-Host "Updating Powershell Help cmds - I recommend doing a full Update-Help if missing commands" - Update-Help -Module "Microsoft.PowerShell*" - Write-Host "Running O&O Shutup with Recommended Settings" Import-Module BitsTransfer Start-BitsTransfer -Source "https://raw.githubusercontent.com/ChrisTitusTech/win10script/master/ooshutup10.cfg" -Destination ooshutup10.cfg @@ -779,7 +580,7 @@ $essentialundo.Add_Click({ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" -Name "PeopleBand" -Type DWord -Value 1 Write-Host "Hiding tray icons..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Type DWord -Value 1 - + Write-Host "Changing default Explorer view to Quick Access..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 0 @@ -834,8 +635,6 @@ $cortana.Add_Click({ Write-Host "Disabled Cortana" }) - - $defaultwindowsupdate.Add_Click({ Write-Host "Enabling driver offering through Windows Update..." Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -ErrorAction SilentlyContinue @@ -943,7 +742,7 @@ $lightmode.Add_Click({ $EActionCenter.Add_Click({ Write-Host "Enabling Action Center..." Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter" -ErrorAction SilentlyContinue - Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" -ErrorAction SilentlyContinue Write-Host "Done - Reverted to Stock Settings" }) @@ -956,7 +755,7 @@ $ECortana.Add_Click({ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 0 Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 0 Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -ErrorAction SilentlyContinue - Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -ErrorAction SilentlyContinue Write-Host "Restoring Windows Search..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value "1" Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "CortanaConsent" -ErrorAction SilentlyContinue @@ -965,21 +764,20 @@ $ECortana.Add_Click({ Set-Service "WSearch" -StartupType Automatic Start-Service "WSearch" -WarningAction SilentlyContinue Write-Host "Restore Windows Search Icon..." - Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Type DWord -Value 1 + Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Type DWord -Value 1 Write-Host "Done - Reverted to Stock Settings" }) $HTrayIcons.Add_Click({ - $ErrorActionPreference = 'SilentlyContinue' Write-Host "Hiding tray icons..." - Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -ErrorAction SilentlyContinue Write-Host "Done - Reverted to Stock Settings" }) $EClipboardHistory.Add_Click({ Write-Host "Restoring Clipboard History..." Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Clipboard" -Name "EnableClipboardHistory" -ErrorAction SilentlyContinue - Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "AllowClipboardHistory" -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "AllowClipboardHistory" -ErrorAction SilentlyContinue Write-Host "Done - Reverted to Stock Settings" }) @@ -998,7 +796,7 @@ $ELocation.Add_Click({ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessLocation" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessLocation_UserInControlOfTheseApps" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessLocation_ForceAllowTheseApps" -ErrorAction SilentlyContinue - Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessLocation_ForceDenyTheseApps" -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessLocation_ForceDenyTheseApps" -ErrorAction SilentlyContinue Write-Host "Done - Reverted to Stock Settings" }) @@ -1047,4 +845,4 @@ $yourphonefix.Add_Click({ Write-Host "You may need to Reboot and right-click Your Phone app and select repair" }) -[void]$Form.ShowDialog() +[void]$Form.ShowDialog() \ No newline at end of file