summaryrefslogtreecommitdiff
path: root/static/get.ps1
diff options
context:
space:
mode:
authorWindowsAddict2024-09-03 01:45:55 +0000
committerWindowsAddict2024-09-03 01:45:55 +0000
commit9260b8e92c7fce07c5ebcdd2d93b1e26069008bc (patch)
tree9c66fff2dc561bd962f1dedcb8da464019931357 /static/get.ps1
parentc7cf78dd00e94f28bcf39682597ed851915894bb (diff)
downloadmassgrave.dev-9260b8e92c7fce07c5ebcdd2d93b1e26069008bc.zip
Detect Autorun registry which may create issues with CMD
Diffstat (limited to 'static/get.ps1')
-rw-r--r--static/get.ps18
1 files changed, 8 insertions, 0 deletions
diff --git a/static/get.ps1 b/static/get.ps1
index 8975be3..d1e7de5 100644
--- a/static/get.ps1
+++ b/static/get.ps1
@@ -38,6 +38,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" }