diff --git a/README.md b/README.md index bc76f81f..ec818022 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,16 @@ Or shorter Thanks to [#144](/../../issues/144) ``` irm https://christitus.com/win | iex ``` -If you are having TLS 1.2 Issues or You cannot find or resolve `christitus.com/win` then run with the following command: +### Issues: + +- If you can't resolve christitus.com/win and getting errors launching India Region is BLOCKING raw github files and you need to VPN outside India. + +Source: + +- AntiVirus is also blocking the script. You can disable it temporarily to run the script. The script is flagged for malware because it runs under the administrator and makes system changes. + +- If you are having TLS 1.2 Issues or You cannot find or resolve `christitus.com/win` then run with the following command: + ``` [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;iex(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/winutil.ps1') ``` diff --git a/config/tweaks.json b/config/tweaks.json index cc219401..d0497c39 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -1885,42 +1885,6 @@ } ] }, - "WPFMiscTweaksLapPower": { - "registry": [ - { - "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Power\\PowerThrottling", - "Name": "PowerThrottlingOff", - "Type": "DWord", - "Value": "00000000", - "OriginalValue": "00000001" - }, - { - "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", - "Name": "HiberbootEnabled", - "Type": "DWord", - "Value": "0000001", - "OriginalValue": "0000000" - } - ] - }, - "WPFMiscTweaksPower": { - "registry": [ - { - "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Power\\PowerThrottling", - "Name": "PowerThrottlingOff", - "Type": "DWord", - "Value": "00000001", - "OriginalValue": "00000000" - }, - { - "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", - "Name": "HiberbootEnabled", - "Type": "DWord", - "Value": "0000000", - "OriginalValue": "00000001" - } - ] - }, "WPFMiscTweaksExt": { "registry": [ { @@ -2208,7 +2172,87 @@ " ], "UndoScript": [ - "winget install Microsoft.Edge" + " + Write-Host \"Install Microsoft Edge\" + Start-Process -FilePath winget -ArgumentList \"install -e --accept-source-agreements --accept-package-agreements --silent Microsoft.Edge \" -NoNewWindow -Wait + " + ] + }, + "WPFEssTweaksRemoveOnedrive": { + "InvokeScript": [ + " + + Write-Host \"Kill OneDrive process\" + taskkill.exe /F /IM \"OneDrive.exe\" + taskkill.exe /F /IM \"explorer.exe\" + + Write-Host \"Copy all OneDrive to Root UserProfile\" + Start-Process -FilePath robocopy -ArgumentList \"$env:USERPROFILE\\OneDrive $env:USERPROFILE /e /xj\" -NoNewWindow -Wait + + Write-Host \"Remove OneDrive\" + Start-Process -FilePath winget -ArgumentList \"uninstall -e --purge --force --silent Microsoft.OneDrive \" -NoNewWindow -Wait + + Write-Host \"Removing OneDrive leftovers\" + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$env:localappdata\\Microsoft\\OneDrive\" + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$env:programdata\\Microsoft OneDrive\" + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$env:systemdrive\\OneDriveTemp\" + # check if directory is empty before removing: + If ((Get-ChildItem \"$env:userprofile\\OneDrive\" -Recurse | Measure-Object).Count -eq 0) { + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$env:userprofile\\OneDrive\" + } + + Write-Host \"Remove Onedrive from explorer sidebar\" + Set-ItemProperty -Path \"HKCR:\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" -Name \"System.IsPinnedToNameSpaceTree\" -Value 0 + Set-ItemProperty -Path \"HKCR:\\Wow6432Node\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" -Name \"System.IsPinnedToNameSpaceTree\" -Value 0 + + Write-Host \"Removing run hook for new users\" + reg load \"hku\\Default\" \"C:\\Users\\Default\\NTUSER.DAT\" + reg delete \"HKEY_USERS\\Default\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\" /v \"OneDriveSetup\" /f + reg unload \"hku\\Default\" + + Write-Host \"Removing startmenu entry\" + Remove-Item -Force -ErrorAction SilentlyContinue \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\OneDrive.lnk\" + + Write-Host \"Removing scheduled task\" + Get-ScheduledTask -TaskPath '\\' -TaskName 'OneDrive*' -ea SilentlyContinue | Unregister-ScheduledTask -Confirm:$false + + # Add Shell folders restoring default locations + Write-Host \"Shell Fixing\" + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"AppData\" -Value \"$env:userprofile\\AppData\\Roaming\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Cache\" -Value \"$env:userprofile\\AppData\\Local\\Microsoft\\Windows\\INetCache\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Cookies\" -Value \"$env:userprofile\\AppData\\Local\\Microsoft\\Windows\\INetCookies\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Favorites\" -Value \"$env:userprofile\\Favorites\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"History\" -Value \"$env:userprofile\\AppData\\Local\\Microsoft\\Windows\\History\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Local AppData\" -Value \"$env:userprofile\\AppData\\Local\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"My Music\" -Value \"$env:userprofile\\Music\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"My Video\" -Value \"$env:userprofile\\Videos\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"NetHood\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Network Shortcuts\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"PrintHood\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Printer Shortcuts\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Programs\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Recent\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Recent\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"SendTo\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\SendTo\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Start Menu\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Startup\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Templates\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Templates\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"{374DE290-123F-4565-9164-39C4925E467B}\" -Value \"$env:userprofile\\Downloads\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Desktop\" -Value \"$env:userprofile\\Desktop\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"My Pictures\" -Value \"$env:userprofile\\Pictures\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Personal\" -Value \"$env:userprofile\\Documents\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"{F42EE2D3-909F-4907-8871-4C22FC0BF756}\" -Value \"$env:userprofile\\Documents\" -Type ExpandString + Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"{0DDD015D-B06C-45D5-8C4C-F59713854639}\" -Value \"$env:userprofile\\Pictures\" -Type ExpandString + Write-Host \"Restarting explorer\" + Start-Process \"explorer.exe\" + + Write-Host \"Waiting for explorer to complete loading\" + Write-Host \"Please Note - OneDrive folder may still have items in it. You must manually delete it, but all the files should already be copied to the base user folder.\" + Start-Sleep 5 + " + ], + "UndoScript": [ + " + Write-Host \"Install OneDrive\" + Start-Process -FilePath winget -ArgumentList \"install -e --accept-source-agreements --accept-package-agreements --silent Microsoft.OneDrive \" -NoNewWindow -Wait + " ] }, "WPFMiscTweaksDisableNotifications": { @@ -2248,17 +2292,6 @@ " ] }, - "WPFMiscTweaksDisableTPMCheck": { - "registry": [ - { - "Path": "HKLM:\\SYSTEM\\Setup\\MoSetup", - "Name": "AllowUpgradesWithUnsupportedTPM", - "Type": "DWord", - "Value": "1", - "OriginalValue": "0" - } - ] - }, "WPFMiscTweaksDisableUAC": { "registry": [ { @@ -2337,15 +2370,6 @@ Get-ChildItem -Path $env:TEMP *.* -Recurse | Remove-Item -Force -Recurse" ] }, - "WPFEssTweaksRemoveCortana": { - "InvokeScript": [ - "Get-AppxPackage -allusers Microsoft.549981C3F5F10 | Remove-AppxPackage" - ], - "UndoScript": [ - "Get-AppxPackage -allusers | where Name -like \"Microsoft.549981C3F5F10\" | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"} - " - ] - }, "WPFEssTweaksDVR": { "registry": [ { diff --git a/functions/private/Install-WinUtilProgramWinget.ps1 b/functions/private/Install-WinUtilProgramWinget.ps1 index 80cfb60d..13b2afde 100644 --- a/functions/private/Install-WinUtilProgramWinget.ps1 +++ b/functions/private/Install-WinUtilProgramWinget.ps1 @@ -26,7 +26,7 @@ Function Install-WinUtilProgramWinget { Start-Process -FilePath winget -ArgumentList "install -e --accept-source-agreements --accept-package-agreements --silent $Program" -NoNewWindow -Wait } if($manage -eq "Uninstalling"){ - Start-Process -FilePath winget -ArgumentList "remove -e --purge --force --silent $Program" -NoNewWindow -Wait + Start-Process -FilePath winget -ArgumentList "uninstall -e --purge --force --silent $Program" -NoNewWindow -Wait } $X++ diff --git a/winutil.ps1 b/winutil.ps1 index 9fa5aa22..cb5f7ecb 100755 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -10,6 +10,7 @@ Author : Chris Titus @christitustech Runspace Author: @DeveloperDurp GitHub : https://github.com/ChrisTitusTech + Version : 23.09.13 Version : 23.09.11 #> @@ -21,6 +22,7 @@ Add-Type -AssemblyName System.Windows.Forms # variable to sync between runspaces $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot +$sync.version = "23.09.13" $sync.version = "23.09.11" $sync.configs = @{} $sync.ProcessRunning = $false @@ -270,7 +272,7 @@ Function Install-WinUtilProgramWinget { Start-Process -FilePath winget -ArgumentList "install -e --accept-source-agreements --accept-package-agreements --silent $Program" -NoNewWindow -Wait } if($manage -eq "Uninstalling"){ - Start-Process -FilePath winget -ArgumentList "remove -e --purge --force --silent $Program" -NoNewWindow -Wait + Start-Process -FilePath winget -ArgumentList "uninstall -e --purge --force --silent $Program" -NoNewWindow -Wait } $X++ @@ -794,6 +796,7 @@ function Set-WinUtilRestorePoint { Checkpoint-Computer -Description $description -RestorePointType "MODIFY_SETTINGS" Write-Host -ForegroundColor Green "System Restore Point Created Successfully" + Write-Host -ForegroundColor Green "System Restore Point Created Successfully" } } function Set-WinUtilScheduledTask { @@ -2445,6 +2448,8 @@ $inputXML = ' + + @@ -2571,8 +2576,6 @@ $inputXML = '