diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Module/Sophia.psm1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Module/Sophia.psm1 index e76b66f4..f59f473c 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Module/Sophia.psm1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Module/Sophia.psm1 @@ -7375,6 +7375,10 @@ function CleanupTask ) foreach ($VolumeCache in $VolumeCaches) { + if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache")) + { + New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Force + } New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Name StateFlags1337 -PropertyType DWord -Value 2 -Force } diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Module/Sophia.psm1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Module/Sophia.psm1 index a12bab4f..f6fe9ee2 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Module/Sophia.psm1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Module/Sophia.psm1 @@ -8475,6 +8475,10 @@ function CleanupTask ) foreach ($VolumeCache in $VolumeCaches) { + if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache")) + { + New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Force + } New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Name StateFlags1337 -PropertyType DWord -Value 2 -Force } diff --git a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Module/Sophia.psm1 b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Module/Sophia.psm1 index f48ca4b3..28d3edf2 100644 --- a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Module/Sophia.psm1 +++ b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Module/Sophia.psm1 @@ -10729,6 +10729,10 @@ function CleanupTask ) foreach ($VolumeCache in $VolumeCaches) { + if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache")) + { + New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Force + } New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Name StateFlags1337 -PropertyType DWord -Value 2 -Force } diff --git a/Sophia Script/Sophia Script for Windows 10/Module/Sophia.psm1 b/Sophia Script/Sophia Script for Windows 10/Module/Sophia.psm1 index 9bffbde0..084dee67 100644 --- a/Sophia Script/Sophia Script for Windows 10/Module/Sophia.psm1 +++ b/Sophia Script/Sophia Script for Windows 10/Module/Sophia.psm1 @@ -10688,6 +10688,10 @@ function CleanupTask ) foreach ($VolumeCache in $VolumeCaches) { + if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache")) + { + New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Force + } New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Name StateFlags1337 -PropertyType DWord -Value 2 -Force } diff --git a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Module/Sophia.psm1 b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Module/Sophia.psm1 index 170e8de2..f6221cc9 100644 --- a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Module/Sophia.psm1 +++ b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Module/Sophia.psm1 @@ -10192,6 +10192,10 @@ function CleanupTask ) foreach ($VolumeCache in $VolumeCaches) { + if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache")) + { + New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Force + } New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Name StateFlags1337 -PropertyType DWord -Value 2 -Force } diff --git a/Sophia Script/Sophia Script for Windows 11/Module/Sophia.psm1 b/Sophia Script/Sophia Script for Windows 11/Module/Sophia.psm1 index d01c5d6c..b50356b2 100644 --- a/Sophia Script/Sophia Script for Windows 11/Module/Sophia.psm1 +++ b/Sophia Script/Sophia Script for Windows 11/Module/Sophia.psm1 @@ -10152,6 +10152,10 @@ function CleanupTask ) foreach ($VolumeCache in $VolumeCaches) { + if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache")) + { + New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Force + } New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Name StateFlags1337 -PropertyType DWord -Value 2 -Force }