diff options
| author | WindowsAddict | 2024-09-03 01:43:51 +0000 |
|---|---|---|
| committer | WindowsAddict | 2024-09-03 01:43:51 +0000 |
| commit | 81182013c0989f361662363f73b4b21a9a60cec8 (patch) | |
| tree | 4827f116076bc87c4ce36e2f06b86a7cca8468a8 | |
| parent | bff5cebcc3b1456263cf874ff7dbab193967dcf3 (diff) | |
| download | massgravel.github.io-81182013c0989f361662363f73b4b21a9a60cec8.zip | |
Detect AutoRun registry which may create issues with CMD
| -rw-r--r-- | get | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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" }
|
