diff --git a/README.md b/README.md index f047f65..d1fb042 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,10 @@ This software is in beta. **All scripts are provided as-is and you use them at y ## Contributing -Contributions are welcome, just make a pull request and we'll accept it if it's actually helpful. +Contributions are welcomed, just make a pull request and we'll accept it if it's actually helpful. ## Execution -Before launching the script(s), run these commands: +Before launching the script, run these commands: Enable execution of PowerShell scripts: @@ -21,6 +21,8 @@ Unblock PowerShell scripts and modules within this directory: PS> ls -Recurse *.ps*1 | Unblock-File +To run WindowsToolbox, run "WindowsToolbox.cmd" + ## Liability **All scripts are provided as-is and you use them at your own risk.** diff --git a/library/GeneralFunctions.psm1 b/library/GeneralFunctions.psm1 index 9fe74ae..69675a9 100644 --- a/library/GeneralFunctions.psm1 +++ b/library/GeneralFunctions.psm1 @@ -1,6 +1,6 @@ # General functions -$version = "1.0.0-beta.3" +$version = "1.0.0-beta.5" $build = (Get-CimInstance Win32_OperatingSystem).version $winver = (Get-WmiObject -class Win32_OperatingSystem).Caption @@ -13,7 +13,7 @@ function setup { $winver = '10' } } -function Exit { +function Quit { stop-process -id $PID } @@ -24,6 +24,9 @@ function Restart { function Info { Write-Output "Windows Toolbox $version" Write-Output "Windows build $build" + if ($version -lt "$version") { + Write-Output "Older version of WindowsToolbox is detected, please update WindowsToolbox" + } Write-Output "" Write-Output "" Write-Output "Please read before using WindowsToolbox" diff --git a/library/PrivacyFunctions.psm1 b/library/PrivacyFunctions.psm1 index e87eda0..8ccee8c 100644 --- a/library/PrivacyFunctions.psm1 +++ b/library/PrivacyFunctions.psm1 @@ -1,4 +1,4 @@ -function Disable-Telemetry { +function DisableTelemetry { Write-Output "Disabling telemetry via Group Policies" New-FolderForced -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" "AllowTelemetry" 0 @@ -22,7 +22,7 @@ function Disable-Telemetry { "a1621.g.akamai.net" "a1856.g2.akamai.net" "a1961.g.akamai.net" - #"a248.e.akamai.net" # makes iTunes download button disappear (#43) + #"a248.e.akamai.net" # makes iTunes download button disappear "a978.i6g1.akamai.net" "a.ads1.msn.com" "a.ads2.msads.net" @@ -210,12 +210,55 @@ function Disable-Telemetry { Remove-NetFirewallRule -DisplayName "Block Telemetry IPs" -ErrorAction SilentlyContinue New-NetFirewallRule -DisplayName "Block Telemetry IPs" -Direction Outbound ` -Action Block -RemoteAddress ([string[]]$ips) + Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0 + Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0 + Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0 + If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds")) { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" -Force | Out-Null + } + Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" -Name "AllowBuildPreview" -Type DWord -Value 0 + If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform")) { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" -Force | Out-Null + } + Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" -Name "NoGenTicket" -Type DWord -Value 1 + If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\SQMClient\Windows")) { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\SQMClient\Windows" -Force | Out-Null + } + Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\SQMClient\Windows" -Name "CEIPEnable" -Type DWord -Value 0 + If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat")) { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat" -Force | Out-Null + } + Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat" -Name "AITEnable" -Type DWord -Value 0 + Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat" -Name "DisableInventory" -Type DWord -Value 1 + If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\AppV\CEIP")) { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\AppV\CEIP" -Force | Out-Null + } + Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\AppV\CEIP" -Name "CEIPEnable" -Type DWord -Value 0 + If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\TabletPC")) { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\TabletPC" -Force | Out-Null + } + Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\TabletPC" -Name "PreventHandwritingDataSharing" -Type DWord -Value 1 + If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput")) { + New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput" -Force | Out-Null + } + Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput" -Name "AllowLinguisticDataCollection" -Type DWord -Value 0 + Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" | Out-Null + Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\ProgramDataUpdater" | Out-Null + Disable-ScheduledTask -TaskName "Microsoft\Windows\Autochk\Proxy" | Out-Null + Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" | Out-Null + Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" | Out-Null + Disable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null + # Office 2016 / 2019 + Disable-ScheduledTask -TaskName "Microsoft\Office\Office ClickToRun Service Monitor" -ErrorAction SilentlyContinue | Out-Null + Disable-ScheduledTask -TaskName "Microsoft\Office\OfficeTelemetryAgentFallBack2016" -ErrorAction SilentlyContinue | Out-Null + Disable-ScheduledTask -TaskName "Microsoft\Office\OfficeTelemetryAgentLogOn2016" -ErrorAction SilentlyContinue | Out-Null + Write-Output "Done" } function PrivacyFixSettings { # Description: - # This script will try to fix many of the privacy settings for the user. This - # is work in progress! + <# This script will try to fix many of the privacy settings for the user. This + is work in progress!#> Import-Module -DisableNameChecking $PSScriptRoot\..\lib\New-FolderForced.psm1 Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 @@ -380,4 +423,12 @@ function DisableAdvertisingID { } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Name "DisabledByGroupPolicy" -Type DWord -Value 1 Write-Output "done" +} + +function DisableActivityHistory { + Write-Output "Disabling Activity History..." + Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableActivityFeed" -Type DWord -Value 0 + Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "PublishUserActivities" -Type DWord -Value 0 + Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "UploadUserActivities" -Type DWord -Value 0 + Write-Output "Done" } \ No newline at end of file diff --git a/library/Tweaks.psm1 b/library/Tweaks.psm1 index 225910a..3d1f198 100644 --- a/library/Tweaks.psm1 +++ b/library/Tweaks.psm1 @@ -89,6 +89,7 @@ function TBSingleClick { Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LastActiveClick" -Type Dword -Value 0x00000001 -Force Write-Output "Done" } + # UI Tweaks function RemoveThisPClutter { @@ -130,4 +131,62 @@ function DisableAeroShake { Write-Output "Disabling Aero Shake..." Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "DisallowShaking" -Type DWord -Value 1 Write-Output "Done" +} + +function DisableActionCenter { + Write-Output "Disabling Action Center (Notification Center)..." + If (!(Test-Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer")) { + New-Item -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" | Out-Null + } + Set-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter" -Type DWord -Value 1 + Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" -Type DWord -Value 0 + Write-Output "Done" +} + +function DisableAccessibilityKeys { + Write-Output "Disabling accessibility keys prompts..." + Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name "Flags" -Type String -Value "506" + Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\ToggleKeys" -Name "Flags" -Type String -Value "58" + Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\Keyboard Response" -Name "Flags" -Type String -Value "122" + Write-Output "Done" +} + +function FixNoInternetPrompt { + if((Test-Path -LiteralPath "HKLM:\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet") -ne $true) { New-Item "HKLM:\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet" -force -ea SilentlyContinue }; + New-ItemProperty -LiteralPath 'HKLM:\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet' -Name 'EnableActiveProbingl' -Value 1 -PropertyType DWord -Force -ea SilentlyContinue; +} + +function SetWinXMenuCMD { + Write-Output "Setting Command prompt instead of PowerShell in WinX menu..." + If ([System.Environment]::OSVersion.Version.Build -le 14393) { + Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "DontUsePowerShellOnWinX" -ErrorAction SilentlyContinue + } Else { + Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "DontUsePowerShellOnWinX" -Type DWord -Value 1 + } +} + +function ShowBuildNumberOnDesktop { + Write-Output "Showing Windows build number on desktop..." + Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "PaintDesktopVersion" -Type DWord -Value 1 + Write-Output "Done" +} + +function ShowExplorerFullPath { + Write-Output "Showing full directory path in Explorer title bar..." + If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState")) { + New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState" -Force | Out-Null + } + Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState" -Name "FullPath" -Type DWord -Value 1 + Write-Output "Done" +} + +function EnableVerboseStartup { + Write-Output "Enabling verbose startup/shutdown status messages..." + if ((Get-CimInstance -Class "Win32_OperatingSystem").ProductType -eq 1) { + Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "VerboseStatus" -Type DWord -Value 1 + } + else { + Remove-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "VerboseStatus" -ErrorAction SilentlyContinue + } + Write-Output "Done" } \ No newline at end of file diff --git a/main.ps1 b/main.ps1 index 62d97d4..2ffbfb3 100644 --- a/main.ps1 +++ b/main.ps1 @@ -66,6 +66,7 @@ $objects = @{ 'Disable App Suggestions', 'Disable Tailored Experiences', 'Disable Advertising ID' + 'Disable Activity History' )" 'Tweaks' = @{ @@ -81,12 +82,24 @@ $objects = @{ 'Improve SSD Lifespan (HIGHLY RECOMMENDED IF YOU HAVE AN SSD)' )" - 'UI Tweaks' = "@( - 'Remove user folders under This PC', - 'Enable dark mode', - 'Disable Aero Shake', - 'Switch Windows With a Single Click on the Taskbar' - )" + 'UI Tweaks' = @{ + 'Shell tweaks' = "@( + 'Enable dark mode', + 'Disable Aero Shake', + 'Switch Windows With a Single Click on the Taskbar', + 'Disable Action Center', + 'Disable Accessibility Keys', + 'Set Win+X menu to Command Prompt', + 'Fix No Internet prompt', + 'Enable verbose startup / shutdown messages' + )" + + 'Explorer tweaks' = "@( + 'Remove user folders under This PC', + 'Show build number on desktop', + 'Show full directory path in Explorer title bar' + )" + } } 'Install Apps' = @{ @@ -167,6 +180,9 @@ do { } # Privacy menu + "Disable Telemetry" { + DisableTelemetry + } "Privacy Fixes (WIP)" { PrivacyFixSettings @@ -183,6 +199,10 @@ do { "Disable Advertising ID" { DisableAdvertisingID } + + "Disable Activity History" { + DisableActivityHistory + } # Install Menu @@ -347,19 +367,43 @@ do { } #UI Tweaks + + #Explorer tweaks "Remove user folders under This PC" { RemoveThisPClutter } + "Show build number on desktop" { + ShowBuildNumberOnDesktop + } + "Show full directory path in Explorer's title bar" { + ShowExplorerFullPath + } + + #Shell tweaks "Enable dark mode" { DarkMode } "Disable Aero Share" { DisableAeroShake } - "Switch Windows With a Single Click on the Taskbar" { TBSingleClick } + "Disable Action Center" { + DisableActionCenter + } + "Disable Accessibility Keys" { + DisableAccessibilityKeys + } + "Fix No Internet prompt" { + FixNoInternetPrompt + } + "Set Win+X menu to Command Prompt" { + SetWinXMenuCMD + } + "Enable verbose startup / shutdown messages" { + EnableVerboseStartup + } # Undo "(Re)Enable Telemetry" { @@ -371,7 +415,7 @@ do { Info } "Exit" { - Exit + Quit } "Reboot" { Restart