mirror of
https://github.com/massgravel/get.activated.win.git
synced 2024-12-27 12:39:50 +01:00
Detect AutoRun registry which may create issues with CMD
This commit is contained in:
parent
bff5cebcc3
commit
81182013c0
1 changed files with 8 additions and 0 deletions
8
get
8
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" }
|
||||
|
|
Loading…
Reference in a new issue