diff --git a/lib/take-own.psm1 b/lib/take-own.psm1 index 6509188a..a4b9a9b6 100644 --- a/lib/take-own.psm1 +++ b/lib/take-own.psm1 @@ -1,106 +1,106 @@ -function Takeown-Registry($key) { - # TODO does not work for all root keys yet - switch ($key.split('\')[0]) { - "HKEY_CLASSES_ROOT" { - $reg = [Microsoft.Win32.Registry]::ClassesRoot - $key = $key.substring(18) - } - "HKEY_CURRENT_USER" { - $reg = [Microsoft.Win32.Registry]::CurrentUser - $key = $key.substring(18) - } - "HKEY_LOCAL_MACHINE" { - $reg = [Microsoft.Win32.Registry]::LocalMachine - $key = $key.substring(19) - } - } - - # get administraor group - $admins = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544") - $admins = $admins.Translate([System.Security.Principal.NTAccount]) - - # set owner - $key = $reg.OpenSubKey($key, "ReadWriteSubTree", "TakeOwnership") - $acl = $key.GetAccessControl() - $acl.SetOwner($admins) - $key.SetAccessControl($acl) - - # set FullControl - $acl = $key.GetAccessControl() - $rule = New-Object System.Security.AccessControl.RegistryAccessRule($admins, "FullControl", "Allow") - $acl.SetAccessRule($rule) - $key.SetAccessControl($acl) -} - -function Takeown-File($path) { - takeown.exe /A /F $path - $acl = Get-Acl $path - - # get administraor group - $admins = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544") - $admins = $admins.Translate([System.Security.Principal.NTAccount]) - - # add NT Authority\SYSTEM - $rule = New-Object System.Security.AccessControl.FileSystemAccessRule($admins, "FullControl", "None", "None", "Allow") - $acl.AddAccessRule($rule) - - Set-Acl -Path $path -AclObject $acl -} - -function Takeown-Folder($path) { - Takeown-File $path - foreach ($item in Get-ChildItem $path) { - if (Test-Path $item -PathType Container) { - Takeown-Folder $item.FullName - } else { - Takeown-File $item.FullName - } - } -} - -function Elevate-Privileges { - param($Privilege) - $Definition = @" - using System; - using System.Runtime.InteropServices; - - public class AdjPriv { - [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)] - internal static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall, ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr rele); - - [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)] - internal static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr phtok); - - [DllImport("advapi32.dll", SetLastError = true)] - internal static extern bool LookupPrivilegeValue(string host, string name, ref long pluid); - - [StructLayout(LayoutKind.Sequential, Pack = 1)] - internal struct TokPriv1Luid { - public int Count; - public long Luid; - public int Attr; - } - - internal const int SE_PRIVILEGE_ENABLED = 0x00000002; - internal const int TOKEN_QUERY = 0x00000008; - internal const int TOKEN_ADJUST_PRIVILEGES = 0x00000020; - - public static bool EnablePrivilege(long processHandle, string privilege) { - bool retVal; - TokPriv1Luid tp; - IntPtr hproc = new IntPtr(processHandle); - IntPtr htok = IntPtr.Zero; - retVal = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok); - tp.Count = 1; - tp.Luid = 0; - tp.Attr = SE_PRIVILEGE_ENABLED; - retVal = LookupPrivilegeValue(null, privilege, ref tp.Luid); - retVal = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero); - return retVal; - } - } -"@ - $ProcessHandle = (Get-Process -id $pid).Handle - $type = Add-Type $definition -PassThru - $type[0]::EnablePrivilege($processHandle, $Privilege) -} +function Takeown-Registry($key) { + # TODO does not work for all root keys yet + switch ($key.split('\')[0]) { + "HKEY_CLASSES_ROOT" { + $reg = [Microsoft.Win32.Registry]::ClassesRoot + $key = $key.substring(18) + } + "HKEY_CURRENT_USER" { + $reg = [Microsoft.Win32.Registry]::CurrentUser + $key = $key.substring(18) + } + "HKEY_LOCAL_MACHINE" { + $reg = [Microsoft.Win32.Registry]::LocalMachine + $key = $key.substring(19) + } + } + + # get administraor group + $admins = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544") + $admins = $admins.Translate([System.Security.Principal.NTAccount]) + + # set owner + $key = $reg.OpenSubKey($key, "ReadWriteSubTree", "TakeOwnership") + $acl = $key.GetAccessControl() + $acl.SetOwner($admins) + $key.SetAccessControl($acl) + + # set FullControl + $acl = $key.GetAccessControl() + $rule = New-Object System.Security.AccessControl.RegistryAccessRule($admins, "FullControl", "Allow") + $acl.SetAccessRule($rule) + $key.SetAccessControl($acl) +} + +function Takeown-File($path) { + takeown.exe /A /F $path + $acl = Get-Acl $path + + # get administraor group + $admins = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544") + $admins = $admins.Translate([System.Security.Principal.NTAccount]) + + # add NT Authority\SYSTEM + $rule = New-Object System.Security.AccessControl.FileSystemAccessRule($admins, "FullControl", "None", "None", "Allow") + $acl.AddAccessRule($rule) + + Set-Acl -Path $path -AclObject $acl +} + +function Takeown-Folder($path) { + Takeown-File $path + foreach ($item in Get-ChildItem $path) { + if (Test-Path $item -PathType Container) { + Takeown-Folder $item.FullName + } else { + Takeown-File $item.FullName + } + } +} + +function Elevate-Privileges { + param($Privilege) + $Definition = @" + using System; + using System.Runtime.InteropServices; + + public class AdjPriv { + [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)] + internal static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall, ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr rele); + + [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)] + internal static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr phtok); + + [DllImport("advapi32.dll", SetLastError = true)] + internal static extern bool LookupPrivilegeValue(string host, string name, ref long pluid); + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + internal struct TokPriv1Luid { + public int Count; + public long Luid; + public int Attr; + } + + internal const int SE_PRIVILEGE_ENABLED = 0x00000002; + internal const int TOKEN_QUERY = 0x00000008; + internal const int TOKEN_ADJUST_PRIVILEGES = 0x00000020; + + public static bool EnablePrivilege(long processHandle, string privilege) { + bool retVal; + TokPriv1Luid tp; + IntPtr hproc = new IntPtr(processHandle); + IntPtr htok = IntPtr.Zero; + retVal = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok); + tp.Count = 1; + tp.Luid = 0; + tp.Attr = SE_PRIVILEGE_ENABLED; + retVal = LookupPrivilegeValue(null, privilege, ref tp.Luid); + retVal = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero); + return retVal; + } + } +"@ + $ProcessHandle = (Get-Process -id $pid).Handle + $type = Add-Type $definition -PassThru + $type[0]::EnablePrivilege($processHandle, $Privilege) +} diff --git a/scripts/Disable-MaxxAudioPro.ps1 b/scripts/Disable-MaxxAudioPro.ps1 new file mode 100644 index 00000000..9e7bf2b1 --- /dev/null +++ b/scripts/Disable-MaxxAudioPro.ps1 @@ -0,0 +1,24 @@ +Disable-ScheduledTask RtHDVBg_PushButton -ErrorAction SilentlyContinue | Out-Null + +# Realtek Audio Service +Stop-Service RtkAudioService +Set-Service RtkAudioService -StartupType Disabled + +# Waves Audio Services +Stop-Service WavesSysSvc +Set-Service WavesSysSvc -StartupType Disabled + +$regFileName = "Disable-MaxxAudioPro.reg" +$regFileContent = @" +Windows Registry Editor Version 5.00 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run] +"RtHDVBg_PushButton"=hex:03,00,00,00,0b,34,17,77,53,4c,d3,01 +"RtHDVBg_WAVES_SKYLAKE"=hex(3):03,00,00,00,4F,89,38,1E,5D,A1,D2,01 +"RTHDVCPL"=hex(3):03,00,00,00,10,C0,D1,1F,5D,A1,D2,01 +"WavesSvc"=hex(3):03,00,00,00,F8,39,39,21,5D,A1,D2,01 +"@ + +$regFileContent | Out-file $regFileName +Start-Process -FilePath "regedit.exe" -ArgumentList "/s", """$regFileName""" -Wait +Remove-Item $regFileName diff --git a/scripts/disable-services.ps1 b/scripts/disable-services.ps1 index 4af0d22f..78cf9db7 100644 --- a/scripts/disable-services.ps1 +++ b/scripts/disable-services.ps1 @@ -1,34 +1,34 @@ -# Description: -# This script disables unwanted Windows services. If you do not want to disable -# certain services comment out the corresponding lines below. - -$services = @( - "diagnosticshub.standardcollector.service" # Microsoft (R) Diagnostics Hub Standard Collector Service - "DiagTrack" # Diagnostics Tracking Service - "dmwappushservice" # WAP Push Message Routing Service - "HomeGroupListener" # HomeGroup Listener - "HomeGroupProvider" # HomeGroup Provider - "lfsvc" # Geolocation Service - "MapsBroker" # Downloaded Maps Manager - "NetTcpPortSharing" # Net.Tcp Port Sharing Service - "RemoteAccess" # Routing and Remote Access - "RemoteRegistry" # Remote Registry - "SharedAccess" # Internet Connection Sharing (ICS) - "TrkWks" # Distributed Link Tracking Client - "WbioSrvc" # Windows Biometric Service - #"WlanSvc" # WLAN AutoConfig - "WMPNetworkSvc" # Windows Media Player Network Sharing Service - "wscsvc" # Windows Security Center Service - #"WSearch" # Windows Search - "XblAuthManager" # Xbox Live Auth Manager - "XblGameSave" # Xbox Live Game Save Service - "XboxNetApiSvc" # Xbox Live Networking Service - - # Services which cannot be disabled - #"WdNisSvc" -) - -foreach ($service in $services) { - echo "Trying to disable $service" - Get-Service -Name $service | Set-Service -StartupType Disabled -} +# Description: +# This script disables unwanted Windows services. If you do not want to disable +# certain services comment out the corresponding lines below. + +$services = @( + "diagnosticshub.standardcollector.service" # Microsoft (R) Diagnostics Hub Standard Collector Service + "DiagTrack" # Diagnostics Tracking Service + "dmwappushservice" # WAP Push Message Routing Service + "HomeGroupListener" # HomeGroup Listener + "HomeGroupProvider" # HomeGroup Provider + #"lfsvc" # Geolocation Service + "MapsBroker" # Downloaded Maps Manager + "NetTcpPortSharing" # Net.Tcp Port Sharing Service + "RemoteAccess" # Routing and Remote Access + #"RemoteRegistry" # Remote Registry + "SharedAccess" # Internet Connection Sharing (ICS) + #"TrkWks" # Distributed Link Tracking Client + #"WbioSrvc" # Windows Biometric Service + #"WlanSvc" # WLAN AutoConfig + "WMPNetworkSvc" # Windows Media Player Network Sharing Service + "wscsvc" # Windows Security Center Service + #"WSearch" # Windows Search + "XblAuthManager" # Xbox Live Auth Manager + "XblGameSave" # Xbox Live Game Save Service + "XboxNetApiSvc" # Xbox Live Networking Service + + # Services which cannot be disabled + #"WdNisSvc" +) + +foreach ($service in $services) { + echo "Trying to disable $service" + Get-Service -Name $service | Set-Service -StartupType Disabled +} diff --git a/scripts/experimental_unfuckery.ps1 b/scripts/experimental_unfuckery.ps1 index e8ff8cb8..3761fc47 100644 --- a/scripts/experimental_unfuckery.ps1 +++ b/scripts/experimental_unfuckery.ps1 @@ -1,47 +1,47 @@ -# Description: -# This script remove strang looking stuff which will probably result in a break -# of your system. It should not be used unless you want to test out a few -# things. It is named `experimental_unfuckery.ps1` for a reason. - -Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 - -echo "Elevating priviledges for this process" -do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) - -echo "Force removing system apps" -$needles = @( - #"Anytime" - "BioEnrollment" - #"Browser" - "ContactSupport" - #"Cortana" # This will disable startmenu search. - #"Defender" - "Feedback" - "Flash" - "Gaming" - #"InternetExplorer" - #"Maps" - "OneDrive" - #"Wallet" - #"Xbox" # This will result in a bootloop since upgrade 1511 -) - -foreach ($needle in $needles) { - echo "Trying to remove all packages containing $needle" - - $pkgs = (ls "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" | - where Name -Like "*$needle*") - - foreach ($pkg in $pkgs) { - $pkgname = $pkg.Name.split('\')[-1] - - Takeown-Registry($pkg.Name) - Takeown-Registry($pkg.Name + "\Owners") - - Set-ItemProperty -Path ("HKLM:" + $pkg.Name.Substring(18)) -Name Visibility -Value 1 - New-ItemProperty -Path ("HKLM:" + $pkg.Name.Substring(18)) -Name DefVis -PropertyType DWord -Value 2 - Remove-Item -Path ("HKLM:" + $pkg.Name.Substring(18) + "\Owners") - - dism.exe /Online /Remove-Package /PackageName:$pkgname /NoRestart - } -} +# Description: +# This script remove strang looking stuff which will probably result in a break +# of your system. It should not be used unless you want to test out a few +# things. It is named `experimental_unfuckery.ps1` for a reason. + +Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 + +echo "Elevating priviledges for this process" +do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) + +echo "Force removing system apps" +$needles = @( + #"Anytime" + "BioEnrollment" + #"Browser" + "ContactSupport" + #"Cortana" # This will disable startmenu search. + #"Defender" + "Feedback" + "Flash" + "Gaming" + #"InternetExplorer" + #"Maps" + "OneDrive" + #"Wallet" + #"Xbox" # This will result in a bootloop since upgrade 1511 +) + +foreach ($needle in $needles) { + echo "Trying to remove all packages containing $needle" + + $pkgs = (ls "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" | + where Name -Like "*$needle*") + + foreach ($pkg in $pkgs) { + $pkgname = $pkg.Name.split('\')[-1] + + Takeown-Registry($pkg.Name) + Takeown-Registry($pkg.Name + "\Owners") + + Set-ItemProperty -Path ("HKLM:" + $pkg.Name.Substring(18)) -Name Visibility -Value 1 + New-ItemProperty -Path ("HKLM:" + $pkg.Name.Substring(18)) -Name DefVis -PropertyType DWord -Value 2 + Remove-Item -Path ("HKLM:" + $pkg.Name.Substring(18) + "\Owners") + + dism.exe /Online /Remove-Package /PackageName:$pkgname /NoRestart + } +} diff --git a/scripts/optimize-user-interface.ps1 b/scripts/optimize-user-interface.ps1 index 92f8db9e..b1dc2434 100644 --- a/scripts/optimize-user-interface.ps1 +++ b/scripts/optimize-user-interface.ps1 @@ -3,7 +3,6 @@ # disable some accessibility features regarding keyboard input. Additional # some UI elements will be changed. -Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1 Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 echo "Elevating priviledges for this process" @@ -32,10 +31,6 @@ sp "HKCU:\Control Panel\Accessibility\StickyKeys" "Flags" "506" sp "HKCU:\Control Panel\Accessibility\Keyboard Response" "Flags" "122" sp "HKCU:\Control Panel\Accessibility\ToggleKeys" "Flags" "58" -echo "Restoring old volume slider" -force-mkdir "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\MTCUVC" -sp "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\MTCUVC" "EnableMtcUvc" 0 - echo "Setting folder view options" sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Hidden" 1 sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "HideFileExt" 0 @@ -44,36 +39,10 @@ sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "HideDriv echo "Setting default explorer view to This PC" sp "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "LaunchTo" 1 -echo "Removing user folders under This PC" -# Remove Desktop from This PC -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}" -# Remove Documents from This PC -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}" -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}" -# Remove Downloads from This PC -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}" -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}" -# Remove Music from This PC -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}" -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" -# Remove Pictures from This PC -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}" -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}" -# Remove Videos from This PC -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" +#echo "Use legacy advanced boot menu" +#bcdedit.exe /set `{current`} bootmenupolicy Legacy -#echo "Disabling tile push notification" -#force-mkdir "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" -#sp "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" "NoTileApplicationNotification" 1 +# src: https://social.technet.microsoft.com/Forums/en-US/fa742f1a-38be-4ca2-9660-da58068214ed +echo "Remove all tiles from start menu" +$e = (New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}') +$e.Items() | %{$_.Verbs()} | ?{$_.Name.replace('&','') -match 'Unpin from Start'} | %{$_.DoIt()} diff --git a/scripts/optimize-windows-update.ps1 b/scripts/optimize-windows-update.ps1 index 3835e93e..bad023e4 100644 --- a/scripts/optimize-windows-update.ps1 +++ b/scripts/optimize-windows-update.ps1 @@ -1,25 +1,7 @@ # Description: # This script optimizes Windows updates by disabling automatic download and # seeding updates to other computers. -# -Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1 - -echo "Disable automatic download and installation of Windows updates" -force-mkdir "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" -sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "NoAutoUpdate" 0 -sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "AUOptions" 2 -sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "ScheduledInstallDay" 0 -sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "ScheduledInstallTime" 3 echo "Disable seeding of updates to other computers via Group Policies" -force-mkdir "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" +mkdir -Force "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" sp "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" "DODownloadMode" 0 - -#echo "Disabling automatic driver update" -#sp "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" "SearchOrderConfig" 0 - -echo "Disable 'Updates are available' message" -takeown /F "$env:WinDIR\System32\MusNotification.exe" -icacls "$env:WinDIR\System32\MusNotification.exe" /deny "Everyone:(X)" -takeown /F "$env:WinDIR\System32\MusNotificationUx.exe" -icacls "$env:WinDIR\System32\MusNotificationUx.exe" /deny "Everyone:(X)" diff --git a/scripts/photo-viewer.ps1 b/scripts/photo-viewer.ps1 new file mode 100644 index 00000000..de2c937a --- /dev/null +++ b/scripts/photo-viewer.ps1 @@ -0,0 +1,105 @@ +# Description +# This script will restore Windows Photo Viewer. + +Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 + +echo "Elevating priviledges for this process" +do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) + +New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT + +mkdir -Force "HKCR:\Applications\photoviewer.dll\shell\open\command" +mkdir -Force "HKCR:\Applications\photoviewer.dll\shell\open\DropTarget" + +mkdir -Force "HKCR:\Applications\photoviewer.dll\shell\print\command" +mkdir -Force "HKCR:\Applications\photoviewer.dll\shell\print\DropTarget" + +cmd /c regsvr32 /s "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll" + +echo "Setting default Photo Viewer to Old Windows Photo Viewer" +sp "HKCR:\Applications\photoviewer.dll\shell\open" "MuiVerb" "@photoviewer.dll,-3043" + +sp "HKCR:\Applications\photoviewer.dll\shell\open\command" '(default)' "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -t e + +sp "HKCR:\Applications\photoviewer.dll\shell\open\DropTarget" "Clsid" "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" + +sp "HKCR:\Applications\photoviewer.dll\shell\print\command" '(default)' "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -t e + +sp "HKCR:\Applications\photoviewer.dll\shell\print\DropTarget]" "Clsid" "{60fd46de-f830-4894-a628-6fa81bc0190d}" + +echo "Set default association for Photo Viewer" +# cmd /c assoc /? +# cmd /c ftype /? + +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.Bitmap\DefaultIcon" +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.Bitmap\shell\open\command" +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.Bitmap\shell\open\DropTarget" +sp "HKCR:\PhotoViewer.FileAssoc.Bitmap" "ImageOptionFlags" 1 -t d +sp "HKCR:\PhotoViewer.FileAssoc.Bitmap" "FriendlyTypeName" "@%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll,-3056" -t e +sp "HKCR:\PhotoViewer.FileAssoc.Bitmap\DefaultIcon" '(default)' "%SystemRoot%\System32\imageres.dll,-70" +sp "HKCR:\PhotoViewer.FileAssoc.Bitmap\shell\open\command" '(default)' "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -t e +sp "HKCR:\PhotoViewer.FileAssoc.Bitmap\shell\open\DropTarget" "Clsid" "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" + +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.JFIF\DefaultIcon" +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.JFIF\shell\open\command" +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.JFIF\shell\open\DropTarget" +sp "HKCR:\PhotoViewer.FileAssoc.JFIF" "EditFlags" 0x10000 -t d +sp "HKCR:\PhotoViewer.FileAssoc.JFIF" "ImageOptionFlags" 1 -t d +sp "HKCR:\PhotoViewer.FileAssoc.JFIF" "FriendlyTypeName" "@%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll,-3055" -t e +sp "HKCR:\PhotoViewer.FileAssoc.JFIF\DefaultIcon" '(default)' "%SystemRoot%\System32\imageres.dll,-72" +sp "HKCR:\PhotoViewer.FileAssoc.JFIF\shell\open" "MuiVerb" "@%ProgramFiles%\Windows Photo Viewer\photoviewer.dll,-3043" -t e +sp "HKCR:\PhotoViewer.FileAssoc.JFIF\shell\open\command" '(default)' "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -t e +sp "HKCR:\PhotoViewer.FileAssoc.JFIF\shell\open\DropTarget" "Clsid" "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" + +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.Jpeg\DefaultIcon" +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.Jpeg\shell\open\command" +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.Jpeg\shell\open\DropTarget" +sp "HKCR:\PhotoViewer.FileAssoc.Jpeg" "EditFlags" 0x10000 -t d +sp "HKCR:\PhotoViewer.FileAssoc.Jpeg" "ImageOptionFlags" 1 -t d +sp "HKCR:\PhotoViewer.FileAssoc.Jpeg" "FriendlyTypeName" "@%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll,-3055" -t e +sp "HKCR:\PhotoViewer.FileAssoc.Jpeg\DefaultIcon" '(default)' "%SystemRoot%\System32\imageres.dll,-72" +sp "HKCR:\PhotoViewer.FileAssoc.Jpeg\shell\open" "MuiVerb" "@%ProgramFiles%\Windows Photo Viewer\photoviewer.dll,-3043" -t e +sp "HKCR:\PhotoViewer.FileAssoc.Jpeg\shell\open\command" '(default)' "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -t e +sp "HKCR:\PhotoViewer.FileAssoc.Jpeg\shell\open\DropTarget" "Clsid" "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" + +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.Gif\DefaultIcon" +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.Gif\shell\open\command" +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.Gif\shell\open\DropTarget" +sp "HKCR:\PhotoViewer.FileAssoc.Gif" "ImageOptionFlags" 1 -t d +sp "HKCR:\PhotoViewer.FileAssoc.Gif" "FriendlyTypeName" "@%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll,-3057" -t e +sp "HKCR:\PhotoViewer.FileAssoc.Gif\DefaultIcon" '(default)' "%SystemRoot%\System32\imageres.dll,-83" +sp "HKCR:\PhotoViewer.FileAssoc.Gif\shell\open\command" '(default)' "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -t e +sp "HKCR:\PhotoViewer.FileAssoc.Gif\shell\open\DropTarget" "Clsid" "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" + +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.Png\DefaultIcon" +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.Png\shell\open\command" +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.Png\shell\open\DropTarget" +sp "HKCR:\PhotoViewer.FileAssoc.Png" "ImageOptionFlags" 1 -t d +sp "HKCR:\PhotoViewer.FileAssoc.Png" "FriendlyTypeName" "@%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll,-3057" -t e +sp "HKCR:\PhotoViewer.FileAssoc.Png\DefaultIcon" '(default)' "%SystemRoot%\System32\imageres.dll,-71" +sp "HKCR:\PhotoViewer.FileAssoc.Png\shell\open\command" '(default)' "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -t e +sp "HKCR:\PhotoViewer.FileAssoc.Png\shell\open\DropTarget" "Clsid" "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" + +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.Wdp\DefaultIcon" +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.Wdp\shell\open\command" +mkdir -Force "HKCR:\PhotoViewer.FileAssoc.Wdp\shell\open\DropTarget" +sp "HKCR:\PhotoViewer.FileAssoc.Wdp" "EditFlags" 0x10000 -t d +sp "HKCR:\PhotoViewer.FileAssoc.Wdp" "ImageOptionFlags" 1 -t d +sp "HKCR:\PhotoViewer.FileAssoc.Wdp\DefaultIcon" '(default)' "%SystemRoot%\System32\imageres.dll,-400" +sp "HKCR:\PhotoViewer.FileAssoc.Wdp\shell\open" "MuiVerb" "@%ProgramFiles%\Windows Photo Viewer\photoviewer.dll,-3043" -t e +sp "HKCR:\PhotoViewer.FileAssoc.Wdp\shell\open\command" '(default)' "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -t e +sp "HKCR:\PhotoViewer.FileAssoc.Wdp\shell\open\DropTarget" "Clsid" "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" + +mkdir -Force "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" +sp "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities" "ApplicationDescription" "@%ProgramFiles%\\Windows Photo Viewer\\photoviewer.dll,-3069" +sp "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities" "ApplicationName" "@%ProgramFiles%\\Windows Photo Viewer\\photoviewer.dll,-3009" +sp "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" ".jpg" "PhotoViewer.FileAssoc.Jpeg" +sp "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" ".wdp" "PhotoViewer.FileAssoc.Wdp" +sp "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" ".jfif" "PhotoViewer.FileAssoc.JFIF" +sp "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" ".dib" "PhotoViewer.FileAssoc.Bitmap" +sp "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" ".png" "PhotoViewer.FileAssoc.Png" +sp "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" ".jxr" "PhotoViewer.FileAssoc.Wdp" +sp "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" ".bmp" "PhotoViewer.FileAssoc.Bitmap" +sp "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" ".jpe" "PhotoViewer.FileAssoc.Jpeg" +sp "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" ".jpeg" "PhotoViewer.FileAssoc.Jpeg" +sp "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" ".gif" "PhotoViewer.FileAssoc.Gif" diff --git a/scripts/remove-default-apps.ps1 b/scripts/remove-default-apps.ps1 index 803644e9..4b1b9fd1 100644 --- a/scripts/remove-default-apps.ps1 +++ b/scripts/remove-default-apps.ps1 @@ -19,9 +19,9 @@ $apps = @( #"Microsoft.FreshPaint" "Microsoft.Getstarted" "Microsoft.MicrosoftOfficeHub" - "Microsoft.MicrosoftSolitaireCollection" + #"Microsoft.MicrosoftSolitaireCollection" #"Microsoft.MicrosoftStickyNotes" - "Microsoft.Office.OneNote" + #"Microsoft.Office.OneNote" #"Microsoft.OneConnect" "Microsoft.People" "Microsoft.SkypeApp" @@ -45,29 +45,14 @@ $apps = @( "Microsoft.Messaging" "Microsoft.Office.Sway" - - #Redstone apps - "Microsoft.BingFoodAndDrink" - "Microsoft.BingTravel" - "Microsoft.BingHealthAndFitness" - "Microsoft.WindowsReadingList" - # non-Microsoft "9E2F88E3.Twitter" - "PandoraMediaInc.29680B314EFC2" "Flipboard.Flipboard" "ShazamEntertainmentLtd.Shazam" "king.com.CandyCrushSaga" "king.com.CandyCrushSodaSaga" "king.com.*" "ClearChannelRadioDigital.iHeartRadio" - "4DF9E0F8.Netflix" - "6Wunderkinder.Wunderlist" - "Drawboard.DrawboardPDF" - "2FE3CB00.PicsArt-PhotoStudio" - "D52A8D61.FarmVille2CountryEscape" - "TuneIn.TuneInRadio" - "GAMELOFTSA.Asphalt8Airborne" #"TheNewYorkTimes.NYTCrossword" # apps which cannot be removed using Remove-AppxPackage diff --git a/scripts/remove-onedrive.ps1 b/scripts/remove-onedrive.ps1 index 9c83a593..17480e74 100644 --- a/scripts/remove-onedrive.ps1 +++ b/scripts/remove-onedrive.ps1 @@ -1,7 +1,6 @@ # Description: # This script will remove and disable OneDrive integration. -Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1 Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 echo "Kill OneDrive process" @@ -23,7 +22,7 @@ rm -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\OneDrive" rm -Recurse -Force -ErrorAction SilentlyContinue "C:\OneDriveTemp" echo "Disable OneDrive via Group Policies" -force-mkdir "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" +mkdir -Force "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" "DisableFileSyncNGSC" 1 echo "Remove Onedrive from explorer sidebar" diff --git a/utils/dark-theme.reg b/utils/dark-theme.reg index 323a4d95..0232c915 100644 --- a/utils/dark-theme.reg +++ b/utils/dark-theme.reg @@ -1,7 +1,7 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize] -"AppsUseLightTheme"=dword:00000000 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize] -"AppsUseLightTheme"=dword:00000000 +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize] +"AppsUseLightTheme"=dword:00000000 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize] +"AppsUseLightTheme"=dword:00000000 diff --git a/utils/disable-scheduled-tasks.ps1 b/utils/disable-scheduled-tasks.ps1 index 29879eaa..30d599b6 100644 --- a/utils/disable-scheduled-tasks.ps1 +++ b/utils/disable-scheduled-tasks.ps1 @@ -1,207 +1,207 @@ -# Description: -# This script will disable certain scheduled tasks. Work in progress! - -$tasks = @( - # Windows base scheduled tasks - "\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319" - "\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64" - "\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64 Critical" - "\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 Critical" - - #"\Microsoft\Windows\Active Directory Rights Management Services Client\AD RMS Rights Policy Template Management (Automated)" - #"\Microsoft\Windows\Active Directory Rights Management Services Client\AD RMS Rights Policy Template Management (Manual)" - - #"\Microsoft\Windows\AppID\EDP Policy Manager" - #"\Microsoft\Windows\AppID\PolicyConverter" - "\Microsoft\Windows\AppID\SmartScreenSpecific" - #"\Microsoft\Windows\AppID\VerifiedPublisherCertStoreCheck" - - "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" - "\Microsoft\Windows\Application Experience\ProgramDataUpdater" - #"\Microsoft\Windows\Application Experience\StartupAppTask" - - #"\Microsoft\Windows\ApplicationData\CleanupTemporaryState" - #"\Microsoft\Windows\ApplicationData\DsSvcCleanup" - - #"\Microsoft\Windows\AppxDeploymentClient\Pre-staged app cleanup" - - "\Microsoft\Windows\Autochk\Proxy" - - #"\Microsoft\Windows\Bluetooth\UninstallDeviceTask" - - #"\Microsoft\Windows\CertificateServicesClient\AikCertEnrollTask" - #"\Microsoft\Windows\CertificateServicesClient\KeyPreGenTask" - #"\Microsoft\Windows\CertificateServicesClient\SystemTask" - #"\Microsoft\Windows\CertificateServicesClient\UserTask" - #"\Microsoft\Windows\CertificateServicesClient\UserTask-Roam" - - #"\Microsoft\Windows\Chkdsk\ProactiveScan" - - #"\Microsoft\Windows\Clip\License Validation" - - "\Microsoft\Windows\CloudExperienceHost\CreateObjectTask" - - "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" - "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" - "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" - - #"\Microsoft\Windows\Data Integrity Scan\Data Integrity Scan" - #"\Microsoft\Windows\Data Integrity Scan\Data Integrity Scan for Crash Recovery" - - #"\Microsoft\Windows\Defrag\ScheduledDefrag" - - #"\Microsoft\Windows\Diagnosis\Scheduled" - - #"\Microsoft\Windows\DiskCleanup\SilentCleanup" - - "\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" - #"\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticResolver" - - #"\Microsoft\Windows\DiskFootprint\Diagnostics" - - "\Microsoft\Windows\Feedback\Siuf\DmClient" - - #"\Microsoft\Windows\File Classification Infrastructure\Property Definition Sync" - - #"\Microsoft\Windows\FileHistory\File History (maintenance mode)" - - #"\Microsoft\Windows\LanguageComponentsInstaller\Installation" - #"\Microsoft\Windows\LanguageComponentsInstaller\Uninstallation" - - #"\Microsoft\Windows\Location\Notifications" - #"\Microsoft\Windows\Location\WindowsActionDialog" - - #"\Microsoft\Windows\Maintenance\WinSAT" - - #"\Microsoft\Windows\Maps\MapsToastTask" - #"\Microsoft\Windows\Maps\MapsUpdateTask" - - #"\Microsoft\Windows\MemoryDiagnostic\ProcessMemoryDiagnosticEvents" - #"\Microsoft\Windows\MemoryDiagnostic\RunFullMemoryDiagnostic" - - "\Microsoft\Windows\Mobile Broadband Accounts\MNO Metadata Parser" - - #"\Microsoft\Windows\MUI\LPRemove" - - #"\Microsoft\Windows\Multimedia\SystemSoundsService" - - #"\Microsoft\Windows\NetCfg\BindingWorkItemQueueHandler" - - #"\Microsoft\Windows\NetTrace\GatherNetworkInfo" - - #"\Microsoft\Windows\Offline Files\Background Synchronization" - #"\Microsoft\Windows\Offline Files\Logon Synchronization" - - #"\Microsoft\Windows\PI\Secure-Boot-Update" - #"\Microsoft\Windows\PI\Sqm-Tasks" - - #"\Microsoft\Windows\Plug and Play\Device Install Group Policy" - #"\Microsoft\Windows\Plug and Play\Device Install Reboot Required" - #"\Microsoft\Windows\Plug and Play\Plug and Play Cleanup" - #"\Microsoft\Windows\Plug and Play\Sysprep Generalize Drivers" - - #"\Microsoft\Windows\Power Efficiency Diagnostics\AnalyzeSystem" - - #"\Microsoft\Windows\Ras\MobilityManager" - - #"\Microsoft\Windows\RecoveryEnvironment\VerifyWinRE" - - #"\Microsoft\Windows\Registry\RegIdleBackup" - - #"\Microsoft\Windows\RemoteAssistance\RemoteAssistanceTask" - - #"\Microsoft\Windows\RemovalTools\MRT_HB" - - #"\Microsoft\Windows\Servicing\StartComponentCleanup" - - #"\Microsoft\Windows\SettingSync\NetworkStateChangeTask" - - #"\Microsoft\Windows\Shell\CreateObjectTask" - #"\Microsoft\Windows\Shell\FamilySafetyMonitor" - #"\Microsoft\Windows\Shell\FamilySafetyRefresh" - #"\Microsoft\Windows\Shell\IndexerAutomaticMaintenance" - - #"\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" - #"\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskLogon" - #"\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskNetwork" - - #"\Microsoft\Windows\SpacePort\SpaceAgentTask" - - #"\Microsoft\Windows\Sysmain\HybridDriveCachePrepopulate" - #"\Microsoft\Windows\Sysmain\HybridDriveCacheRebalance" - #"\Microsoft\Windows\Sysmain\ResPriStaticDbSync" - #"\Microsoft\Windows\Sysmain\WsSwapAssessmentTask" - - #"\Microsoft\Windows\SystemRestore\SR" - - #"\Microsoft\Windows\Task Manager\Interactive" - - #"\Microsoft\Windows\TextServicesFramework\MsCtfMonitor" - - #"\Microsoft\Windows\Time Synchronization\ForceSynchronizeTime" - #"\Microsoft\Windows\Time Synchronization\SynchronizeTime" - - #"\Microsoft\Windows\Time Zone\SynchronizeTimeZone" - - #"\Microsoft\Windows\TPM\Tpm-HASCertRetr" - #"\Microsoft\Windows\TPM\Tpm-Maintenance" - - #"\Microsoft\Windows\UpdateOrchestrator\Maintenance Install" - #"\Microsoft\Windows\UpdateOrchestrator\Policy Install" - #"\Microsoft\Windows\UpdateOrchestrator\Reboot" - #"\Microsoft\Windows\UpdateOrchestrator\Resume On Boot" - #"\Microsoft\Windows\UpdateOrchestrator\Schedule Scan" - #"\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker_Display" - #"\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker_ReadyToReboot" - - #"\Microsoft\Windows\UPnP\UPnPHostConfig" - - #"\Microsoft\Windows\User Profile Service\HiveUploadTask" - - #"\Microsoft\Windows\WCM\WiFiTask" - - #"\Microsoft\Windows\WDI\ResolutionHost" - - "\Microsoft\Windows\Windows Defender\Windows Defender Cache Maintenance" - "\Microsoft\Windows\Windows Defender\Windows Defender Cleanup" - "\Microsoft\Windows\Windows Defender\Windows Defender Scheduled Scan" - "\Microsoft\Windows\Windows Defender\Windows Defender Verification" - - "\Microsoft\Windows\Windows Error Reporting\QueueReporting" - - #"\Microsoft\Windows\Windows Filtering Platform\BfeOnServiceStartTypeChange" - - #"\Microsoft\Windows\Windows Media Sharing\UpdateLibrary" - - #"\Microsoft\Windows\WindowsColorSystem\Calibration Loader" - - #"\Microsoft\Windows\WindowsUpdate\Automatic App Update" - #"\Microsoft\Windows\WindowsUpdate\Scheduled Start" - #"\Microsoft\Windows\WindowsUpdate\sih" - #"\Microsoft\Windows\WindowsUpdate\sihboot" - - #"\Microsoft\Windows\Wininet\CacheTask" - - #"\Microsoft\Windows\WOF\WIM-Hash-Management" - #"\Microsoft\Windows\WOF\WIM-Hash-Validation" - - #"\Microsoft\Windows\Work Folders\Work Folders Logon Synchronization" - #"\Microsoft\Windows\Work Folders\Work Folders Maintenance Work" - - #"\Microsoft\Windows\Workplace Join\Automatic-Device-Join" - - #"\Microsoft\Windows\WS\License Validation" - #"\Microsoft\Windows\WS\WSTask" - - # Scheduled tasks which cannot be disabled - #"\Microsoft\Windows\Device Setup\Metadata Refresh" - #"\Microsoft\Windows\SettingSync\BackgroundUploadTask" -) - -foreach ($task in $tasks) { - $parts = $task.split('\') - $name = $parts[-1] - $path = $parts[0..($parts.length-2)] -join '\' - - Disable-ScheduledTask -TaskName "$name" -TaskPath "$path" -} +# Description: +# This script will disable certain scheduled tasks. Work in progress! + +$tasks = @( + # Windows base scheduled tasks + "\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319" + "\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64" + "\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64 Critical" + "\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 Critical" + + #"\Microsoft\Windows\Active Directory Rights Management Services Client\AD RMS Rights Policy Template Management (Automated)" + #"\Microsoft\Windows\Active Directory Rights Management Services Client\AD RMS Rights Policy Template Management (Manual)" + + #"\Microsoft\Windows\AppID\EDP Policy Manager" + #"\Microsoft\Windows\AppID\PolicyConverter" + "\Microsoft\Windows\AppID\SmartScreenSpecific" + #"\Microsoft\Windows\AppID\VerifiedPublisherCertStoreCheck" + + "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" + "\Microsoft\Windows\Application Experience\ProgramDataUpdater" + #"\Microsoft\Windows\Application Experience\StartupAppTask" + + #"\Microsoft\Windows\ApplicationData\CleanupTemporaryState" + #"\Microsoft\Windows\ApplicationData\DsSvcCleanup" + + #"\Microsoft\Windows\AppxDeploymentClient\Pre-staged app cleanup" + + "\Microsoft\Windows\Autochk\Proxy" + + #"\Microsoft\Windows\Bluetooth\UninstallDeviceTask" + + #"\Microsoft\Windows\CertificateServicesClient\AikCertEnrollTask" + #"\Microsoft\Windows\CertificateServicesClient\KeyPreGenTask" + #"\Microsoft\Windows\CertificateServicesClient\SystemTask" + #"\Microsoft\Windows\CertificateServicesClient\UserTask" + #"\Microsoft\Windows\CertificateServicesClient\UserTask-Roam" + + #"\Microsoft\Windows\Chkdsk\ProactiveScan" + + #"\Microsoft\Windows\Clip\License Validation" + + "\Microsoft\Windows\CloudExperienceHost\CreateObjectTask" + + "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" + "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" + "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" + + #"\Microsoft\Windows\Data Integrity Scan\Data Integrity Scan" + #"\Microsoft\Windows\Data Integrity Scan\Data Integrity Scan for Crash Recovery" + + #"\Microsoft\Windows\Defrag\ScheduledDefrag" + + #"\Microsoft\Windows\Diagnosis\Scheduled" + + #"\Microsoft\Windows\DiskCleanup\SilentCleanup" + + "\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" + #"\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticResolver" + + #"\Microsoft\Windows\DiskFootprint\Diagnostics" + + "\Microsoft\Windows\Feedback\Siuf\DmClient" + + #"\Microsoft\Windows\File Classification Infrastructure\Property Definition Sync" + + #"\Microsoft\Windows\FileHistory\File History (maintenance mode)" + + #"\Microsoft\Windows\LanguageComponentsInstaller\Installation" + #"\Microsoft\Windows\LanguageComponentsInstaller\Uninstallation" + + #"\Microsoft\Windows\Location\Notifications" + #"\Microsoft\Windows\Location\WindowsActionDialog" + + #"\Microsoft\Windows\Maintenance\WinSAT" + + #"\Microsoft\Windows\Maps\MapsToastTask" + #"\Microsoft\Windows\Maps\MapsUpdateTask" + + #"\Microsoft\Windows\MemoryDiagnostic\ProcessMemoryDiagnosticEvents" + #"\Microsoft\Windows\MemoryDiagnostic\RunFullMemoryDiagnostic" + + "\Microsoft\Windows\Mobile Broadband Accounts\MNO Metadata Parser" + + #"\Microsoft\Windows\MUI\LPRemove" + + #"\Microsoft\Windows\Multimedia\SystemSoundsService" + + #"\Microsoft\Windows\NetCfg\BindingWorkItemQueueHandler" + + #"\Microsoft\Windows\NetTrace\GatherNetworkInfo" + + #"\Microsoft\Windows\Offline Files\Background Synchronization" + #"\Microsoft\Windows\Offline Files\Logon Synchronization" + + #"\Microsoft\Windows\PI\Secure-Boot-Update" + #"\Microsoft\Windows\PI\Sqm-Tasks" + + #"\Microsoft\Windows\Plug and Play\Device Install Group Policy" + #"\Microsoft\Windows\Plug and Play\Device Install Reboot Required" + #"\Microsoft\Windows\Plug and Play\Plug and Play Cleanup" + #"\Microsoft\Windows\Plug and Play\Sysprep Generalize Drivers" + + #"\Microsoft\Windows\Power Efficiency Diagnostics\AnalyzeSystem" + + #"\Microsoft\Windows\Ras\MobilityManager" + + #"\Microsoft\Windows\RecoveryEnvironment\VerifyWinRE" + + #"\Microsoft\Windows\Registry\RegIdleBackup" + + #"\Microsoft\Windows\RemoteAssistance\RemoteAssistanceTask" + + #"\Microsoft\Windows\RemovalTools\MRT_HB" + + #"\Microsoft\Windows\Servicing\StartComponentCleanup" + + #"\Microsoft\Windows\SettingSync\NetworkStateChangeTask" + + #"\Microsoft\Windows\Shell\CreateObjectTask" + #"\Microsoft\Windows\Shell\FamilySafetyMonitor" + #"\Microsoft\Windows\Shell\FamilySafetyRefresh" + #"\Microsoft\Windows\Shell\IndexerAutomaticMaintenance" + + #"\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" + #"\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskLogon" + #"\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskNetwork" + + #"\Microsoft\Windows\SpacePort\SpaceAgentTask" + + #"\Microsoft\Windows\Sysmain\HybridDriveCachePrepopulate" + #"\Microsoft\Windows\Sysmain\HybridDriveCacheRebalance" + #"\Microsoft\Windows\Sysmain\ResPriStaticDbSync" + #"\Microsoft\Windows\Sysmain\WsSwapAssessmentTask" + + #"\Microsoft\Windows\SystemRestore\SR" + + #"\Microsoft\Windows\Task Manager\Interactive" + + #"\Microsoft\Windows\TextServicesFramework\MsCtfMonitor" + + #"\Microsoft\Windows\Time Synchronization\ForceSynchronizeTime" + #"\Microsoft\Windows\Time Synchronization\SynchronizeTime" + + #"\Microsoft\Windows\Time Zone\SynchronizeTimeZone" + + #"\Microsoft\Windows\TPM\Tpm-HASCertRetr" + #"\Microsoft\Windows\TPM\Tpm-Maintenance" + + #"\Microsoft\Windows\UpdateOrchestrator\Maintenance Install" + #"\Microsoft\Windows\UpdateOrchestrator\Policy Install" + #"\Microsoft\Windows\UpdateOrchestrator\Reboot" + #"\Microsoft\Windows\UpdateOrchestrator\Resume On Boot" + #"\Microsoft\Windows\UpdateOrchestrator\Schedule Scan" + #"\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker_Display" + #"\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker_ReadyToReboot" + + #"\Microsoft\Windows\UPnP\UPnPHostConfig" + + #"\Microsoft\Windows\User Profile Service\HiveUploadTask" + + #"\Microsoft\Windows\WCM\WiFiTask" + + #"\Microsoft\Windows\WDI\ResolutionHost" + + "\Microsoft\Windows\Windows Defender\Windows Defender Cache Maintenance" + "\Microsoft\Windows\Windows Defender\Windows Defender Cleanup" + "\Microsoft\Windows\Windows Defender\Windows Defender Scheduled Scan" + "\Microsoft\Windows\Windows Defender\Windows Defender Verification" + + "\Microsoft\Windows\Windows Error Reporting\QueueReporting" + + #"\Microsoft\Windows\Windows Filtering Platform\BfeOnServiceStartTypeChange" + + #"\Microsoft\Windows\Windows Media Sharing\UpdateLibrary" + + #"\Microsoft\Windows\WindowsColorSystem\Calibration Loader" + + #"\Microsoft\Windows\WindowsUpdate\Automatic App Update" + #"\Microsoft\Windows\WindowsUpdate\Scheduled Start" + #"\Microsoft\Windows\WindowsUpdate\sih" + #"\Microsoft\Windows\WindowsUpdate\sihboot" + + #"\Microsoft\Windows\Wininet\CacheTask" + + #"\Microsoft\Windows\WOF\WIM-Hash-Management" + #"\Microsoft\Windows\WOF\WIM-Hash-Validation" + + #"\Microsoft\Windows\Work Folders\Work Folders Logon Synchronization" + #"\Microsoft\Windows\Work Folders\Work Folders Maintenance Work" + + #"\Microsoft\Windows\Workplace Join\Automatic-Device-Join" + + #"\Microsoft\Windows\WS\License Validation" + #"\Microsoft\Windows\WS\WSTask" + + # Scheduled tasks which cannot be disabled + #"\Microsoft\Windows\Device Setup\Metadata Refresh" + #"\Microsoft\Windows\SettingSync\BackgroundUploadTask" +) + +foreach ($task in $tasks) { + $parts = $task.split('\') + $name = $parts[-1] + $path = $parts[0..($parts.length-2)] -join '\' + + Disable-ScheduledTask -TaskName "$name" -TaskPath "$path" +} diff --git a/utils/enable-god-mode.ps1 b/utils/enable-god-mode.ps1 index 8a1d1d8d..4e5a2ac7 100644 --- a/utils/enable-god-mode.ps1 +++ b/utils/enable-god-mode.ps1 @@ -1,19 +1,19 @@ -# Description: -# This scripts places the "God Mode" folder on the current user's desktop. - -echo @" -############################################################################### -# _______ _______ ______ __ __ _______ ______ _______ # -# | || || | | |_| || || | | | # -# | ___|| _ || _ | | || _ || _ || ___| # -# | | __ | | | || | | | | || | | || | | || |___ # -# | || || |_| || |_| | | || |_| || |_| || ___| # -# | |_| || || | | ||_|| || || || |___ # -# |_______||_______||______| |_| |_||_______||______| |_______| # -# # -# God Mode has been enabled, check out the new link on your Desktop # -# # -############################################################################### -"@ -$DesktopPath = [Environment]::GetFolderPath("Desktop"); -mkdir "$DesktopPath\GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}" +# Description: +# This scripts places the "God Mode" folder on the current user's desktop. + +echo @" +############################################################################### +# _______ _______ ______ __ __ _______ ______ _______ # +# | || || | | |_| || || | | | # +# | ___|| _ || _ | | || _ || _ || ___| # +# | | __ | | | || | | | | || | | || | | || |___ # +# | || || |_| || |_| | | || |_| || |_| || ___| # +# | |_| || || | | ||_|| || || || |___ # +# |_______||_______||______| |_| |_||_______||______| |_______| # +# # +# God Mode has been enabled, check out the new link on your Desktop # +# # +############################################################################### +"@ +$DesktopPath = [Environment]::GetFolderPath("Desktop"); +mkdir "$DesktopPath\GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}"