From 81182013c0989f361662363f73b4b21a9a60cec8 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 3 Sep 2024 07:13:51 +0530 Subject: [PATCH] Detect AutoRun registry which may create issues with CMD --- get | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/get b/get index 91ba83a..7abcbf7 100644 --- a/get +++ b/get @@ -32,6 +32,14 @@ if ($hash -ne $releaseHash) { return } +# Check for AutoRun registry which may create issues with CMD +$paths = "HKCU:\SOFTWARE\Microsoft\Command Processor", "HKLM:\SOFTWARE\Microsoft\Command Processor" +foreach ($path in $paths) { + if (Get-ItemProperty -Path $path -Name "Autorun" -ErrorAction SilentlyContinue) { + Write-Warning "Autorun registry found, CMD may crash! `nManually copy-paste the below command to fix...`nRemove-ItemProperty -Path '$path' -Name 'Autorun'" + } +} + $rand = [Guid]::NewGuid().Guid $isAdmin = [bool]([Security.Principal.WindowsIdentity]::GetCurrent().Groups -match 'S-1-5-32-544') $FilePath = if ($isAdmin) { "$env:SystemRoot\Temp\MAS_$rand.cmd" } else { "$env:TEMP\MAS_$rand.cmd" }