From 6e231d366e0f32dea5f32e34e99dc07b90366e89 Mon Sep 17 00:00:00 2001 From: Lightemerald Date: Mon, 23 Oct 2023 12:41:01 +0000 Subject: [PATCH] Update setupScriptInfo.ps1 --- setupScriptInfo.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setupScriptInfo.ps1 b/setupScriptInfo.ps1 index d6f2719..cfc53aa 100644 --- a/setupScriptInfo.ps1 +++ b/setupScriptInfo.ps1 @@ -124,7 +124,8 @@ if ($UserSID -ne $null -and $UserHKUPath -ne $null) { $DisallowRunPath = "$UserHKUPath\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" if (-not (Test-Path -Path "Registry::$DisallowRunPath" -PathType Container)) { - New-Item -Path "Registry::$DisallowRunPath" -Force + New-Item -Path $DisallowRunPath -Force + Set-ItemProperty -Path "$UserHKUPath\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "DisallowRun" -Value 1 } $applications = @("cmd.exe", "powershell.exe", "powershell_ise.exe") Get-ItemProperty -Path $DisallowRunPath | ForEach-Object {