diff --git a/src/lib/Open-File.psm1 b/src/lib/Open-File.psm1 index 51491c00..2e807473 100644 --- a/src/lib/Open-File.psm1 +++ b/src/lib/Open-File.psm1 @@ -49,7 +49,7 @@ function Open-RegFilesCollection { ForEach ($FileName in $Scripts) { $LastAccessUtc = "v$((Get-Item "$FileName").LastWriteTimeUtc | Get-Date -Format "yyyy-MM-dd")" $Private:Counter = Write-TitleCounter "$FileName ($LastAccessUtc)" -Counter $Counter -MaxLength $Scripts.Length - regedit /s "$FileName" + Start-Process -FilePath "regedit" -ArgumentList "/s", "$FileName" -Wait } Pop-Location diff --git a/src/lib/debloat-helper/Set-ItemPropertyVerified.psm1 b/src/lib/debloat-helper/Set-ItemPropertyVerified.psm1 index 4b76b335..5e427737 100644 --- a/src/lib/debloat-helper/Set-ItemPropertyVerified.psm1 +++ b/src/lib/debloat-helper/Set-ItemPropertyVerified.psm1 @@ -8,7 +8,7 @@ function Set-ItemPropertyVerified() { [Parameter(Position = 1, Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [String] $Name, [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] - [ValidateSet('Binary', 'DWord', 'ExpandString', 'MultiString', 'Qword', 'String', 'Unknown')] + [ValidateSet('Binary', 'DWord', 'ExpandString', 'MultiString', 'None', 'Qword', 'String', 'Unknown')] [String] $Type, [Parameter(Position = 2, Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] $Value <# Will have dynamic typing #> diff --git a/src/scripts/Register-PersonalTweaksList.ps1 b/src/scripts/Register-PersonalTweaksList.ps1 index b0de45f6..6d5783bd 100644 --- a/src/scripts/Register-PersonalTweaksList.ps1 +++ b/src/scripts/Register-PersonalTweaksList.ps1 @@ -1,3 +1,4 @@ +Import-Module -DisableNameChecking "$PSScriptRoot\..\lib\Get-HardwareInfo.psm1" Import-Module -DisableNameChecking "$PSScriptRoot\..\lib\Open-File.psm1" Import-Module -DisableNameChecking "$PSScriptRoot\..\lib\Title-Templates.psm1" Import-Module -DisableNameChecking "$PSScriptRoot\..\lib\debloat-helper\Remove-ItemVerified.psm1" @@ -7,6 +8,7 @@ Import-Module -DisableNameChecking "$PSScriptRoot\..\utils\Individual-Tweaks.psm # Adapted from: https://github.com/ChrisTitusTech/win10script # Adapted from: https://github.com/Sycnex/Windows10Debloater # Adapted from: https://github.com/kalaspuffar/windows-debloat +# Adapted From: https://learn.microsoft.com/en-us/answers/questions/288732/url-associate-with-internet-browser function Register-PersonalTweaksList() { [CmdletBinding()] @@ -58,6 +60,44 @@ function Register-PersonalTweaksList() { } Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts $Scripts -NoDialog + If ((Get-SystemSpec)[2] -like '*Windows 10*') { + Write-Status -Types "+", $TweakType -Status "Fixing .URL file association with Internet Browser..." + + # Changing .url to Internet Browser by enforcing + Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Classes\IE.AssocFile.URL\DefaultIcon" -Name "(default)" -Type ExpandString -Value "C:\Windows\System32\url.dll,5" + Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Classes\IE.AssocFile.URL\Shell\Open" -Name "CLSID" -Type String -Value "{FBF23B40-E3F0-101B-8488-00AA003E56F8}" + Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Classes\IE.AssocFile.URL\Shell\Open" -Name "LegacyDisable" -Type String -Value "" + Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Classes\IE.AssocFile.URL\Shell\Open\Command" -Name "(default)" -Type String -Value "`"C:\Windows\System32\rundll32.exe`" `"C:\Windows\System32\ieframe.dll`",OpenURL %l" + New-Item -Path "HKLM:\SOFTWARE\Classes\IE.AssocFile.URL\ShellEx" -Force | Out-Null + Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Classes\IE.AssocFile.URL\ShellEx\{000214EE-0000-0000-C000-000000000046}" -Name "(default)" -Type String -Value "{FBF23B40-E3F0-101B-8488-00AA003E56F8}" + Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Classes\IE.AssocFile.URL\ShellEx\{000214F9-0000-0000-C000-000000000046}" -Name "(default)" -Type String -Value "{FBF23B40-E3F0-101B-8488-00AA003E56F8}" + Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Classes\IE.AssocFile.URL\ShellEx\{00021500-0000-0000-C000-000000000046}" -Name "(default)" -Type String -Value "{FBF23B40-E3F0-101B-8488-00AA003E56F8}" + Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Classes\IE.AssocFile.URL\ShellEx\{CABB0DA0-DA57-11CF-9974-0020AFD79762}" -Name "(default)" -Type String -Value "{FBF23B40-E3F0-101B-8488-00AA003E56F8}" + Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Classes\IE.AssocFile.URL\ShellEx\{FBF23B80-E3F0-101B-8488-00AA003E56F8}" -Name "(default)" -Type String -Value "{FBF23B40-E3F0-101B-8488-00AA003E56F8}" + + # Linking InternetShortcut to url files + Set-ItemPropertyVerified -Path "Registry::HKEY_CLASSES_ROOT\.url" -Name "(default)" -Type String -Value "InternetShortcut" + Set-ItemPropertyVerified -Path "Registry::HKEY_CLASSES_ROOT\.url\OpenWithProgIds" -Name "InternetShortcut" -Type String -Value "" + Set-ItemPropertyVerified -Path "Registry::HKEY_CLASSES_ROOT\.url\PersistentHandler" -Name "(default)" -Type String -Value "{8CD34779-9F10-4f9b-ADFB-B3FAEABDAB5A}" + Set-ItemPropertyVerified -Path "Registry::HKEY_CLASSES_ROOT\.url\ShellEx\{000214EE-0000-0000-C000-000000000046}" -Name "(default)" -Type String -Value "{FBF23B40-E3F0-101B-8488-00AA003E56F8}" + Set-ItemPropertyVerified -Path "Registry::HKEY_CLASSES_ROOT\.url\ShellEx\{000214F9-0000-0000-C000-000000000046}" -Name "(default)" -Type String -Value "{FBF23B40-E3F0-101B-8488-00AA003E56F8}" + Set-ItemPropertyVerified -Path "Registry::HKEY_CLASSES_ROOT\.url\ShellEx\{00021500-0000-0000-C000-000000000046}" -Name "(default)" -Type String -Value "{FBF23B40-E3F0-101B-8488-00AA003E56F8}" + Set-ItemPropertyVerified -Path "Registry::HKEY_CLASSES_ROOT\.url\ShellEx\{CABB0DA0-DA57-11CF-9974-0020AFD79762}" -Name "(default)" -Type String -Value "{FBF23B40-E3F0-101B-8488-00AA003E56F8}" + Set-ItemPropertyVerified -Path "Registry::HKEY_CLASSES_ROOT\.url\ShellEx\{FBF23B80-E3F0-101B-8488-00AA003E56F8}" -Name "(default)" -Type String -Value "{FBF23B40-E3F0-101B-8488-00AA003E56F8}" + Set-ItemPropertyVerified -Path "Registry::HKEY_CLASSES_ROOT\InternetShortcut" -Name "(default)" -Type String -Value "InternetShortcut" + Set-ItemPropertyVerified -Path "Registry::HKEY_CLASSES_ROOT\InternetShortcut\DefaultIcon" -Name "(default)" -Type ExpandString -Value "%SystemRoot%\System32\url.dll,5" + Set-ItemPropertyVerified -Path "Registry::HKEY_CLASSES_ROOT\InternetShortcut\tabsets" -Name "selection" -Type DWord -Value 0x00000705 + + # Doing changes to Current User + New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.url\OpenWithList" -Force | Out-Null + Set-ItemPropertyVerified -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.url\OpenWithProgids" -Name "InternetShortcut" -Type None -Value ([byte[]]@()) + Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts "fix-url-association.reg" -NoDialog + Set-ItemPropertyVerified -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.url\UserChoice" -Name "Hash" -Type String -Value "wMx4BywX2RI=" + Set-ItemPropertyVerified -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.url\UserChoice" -Name "ProgId" -Type String -Value "IE.AssocFile.URL" + Set-ItemPropertyVerified -Path "HKCU:\SOFTWARE\Microsoft\Windows\Roaming\OpenWith\FileExts\.url\UserChoice" -Name "Hash" -Type String -Value "wMx4BywX2RI=" + Set-ItemPropertyVerified -Path "HKCU:\SOFTWARE\Microsoft\Windows\Roaming\OpenWith\FileExts\.url\UserChoice" -Name "ProgId" -Type String -Value "IE.AssocFile.URL" + } + # Show Task Manager details - Applicable to 1607 and later - Although this functionality exist even in earlier versions, the Task Manager's behavior is different there and is not compatible with this tweak If ((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name CurrentBuild).CurrentBuild -lt 22557) { Write-Status -Types "+", $TweakType -Status "Showing task manager details..." diff --git a/src/scripts/Remove-BloatwareAppsList.ps1 b/src/scripts/Remove-BloatwareAppsList.ps1 index 2fa92ad0..d9b8643b 100644 --- a/src/scripts/Remove-BloatwareAppsList.ps1 +++ b/src/scripts/Remove-BloatwareAppsList.ps1 @@ -65,7 +65,7 @@ function Remove-BloatwareAppsList() { #"Microsoft.WindowsCamera" # Camera #"Microsoft.ScreenSketch" # Snip and Sketch (now called Snipping tool, replaces the Win32 version in clean installs) #"Microsoft.Windows.DevHome" # Dev Home - #"Microsoft.Windows.Photos" # Photos + #"Microsoft.Windows.Photos" # Photos / Video Editor # [DIY] Can't be reinstalled #"Microsoft.WindowsStore" # Windows Store diff --git a/src/utils/Individual-Tweaks.psm1 b/src/utils/Individual-Tweaks.psm1 index 53cd4be4..3a85ab17 100644 --- a/src/utils/Individual-Tweaks.psm1 +++ b/src/utils/Individual-Tweaks.psm1 @@ -266,7 +266,7 @@ function Disable-LegacyContextMenu() { function Enable-LegacyContextMenu() { Write-Status -Types "+", "Personal" -Status "Enabling legacy context menu on Windows 11 (requires reboot!)..." - New-Item -Path "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" -Value "" -Force + New-Item -Path "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" -Value "" -Force | Out-Null } # Adapted from: https://www.reddit.com/r/gaming/comments/qs0387/i_created_a_powershell_script_to_enabledisable/ diff --git a/src/utils/fix-url-association.reg b/src/utils/fix-url-association.reg new file mode 100644 index 00000000..7b7499a4 --- /dev/null +++ b/src/utils/fix-url-association.reg @@ -0,0 +1,3 @@ +Windows Registry Editor Version 5.00 + +[-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.url\UserChoice]