Many Windows Vista/7 users encounter this bizarre scenario: your account is in the Administrators group, yet PowerShell commands like Stop-Process
return "Access is denied". This happens because:
- User Account Control (UAC) filters admin privileges
- PowerShell sessions don't automatically run elevated
- Some system processes require explicit elevation
The most reliable solution is to explicitly launch PowerShell with admin rights:
# Method 1: Right-click PowerShell shortcut → "Run as administrator"
# Method 2: From cmd.exe:
runas /user:Administrator "powershell -noexit -command \"Start-Process -Verb RunAs powershell\""
Check if your session is truly elevated:
# Returns $true if elevated
([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
For occasional admin tasks without restarting PowerShell:
Start-Process powershell -Verb RunAs -ArgumentList "-command Stop-Process -Name explorer -Force"
To always run PowerShell as admin (not recommended for security):
- Right-click PowerShell shortcut
- Properties → Shortcut → Advanced
- Check "Run as administrator"
If elevation still fails, try these registry tweaks:
# Disable UAC entirely (not secure)
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
# Or set consent prompt behavior (1=Prompt for credentials)
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 1 /f
Even with an administrative account on Windows Vista, you might encounter "Access is denied" errors when trying to terminate certain protected processes through PowerShell. This security behavior stems from Vista's User Account Control (UAC) implementation, which creates a filtered admin token by default.
To execute commands with unrestricted administrative rights, you need to explicitly elevate your PowerShell session:
# Method 1: Right-click PowerShell and select "Run as administrator" # Method 2: From an existing PowerShell prompt: Start-Process powershell -Verb runAs
Once in an elevated session, these commands will work for most processes:
# Basic process termination by name Stop-Process -Name "processname" -Force # Alternative PID-based method Get-Process -Name "processname" | Stop-Process -Force # For stubborn system processes taskkill /F /IM processname.exe
Some Vista system processes require additional steps:
# First take ownership (in admin PowerShell) takeown /F "C:\Windows\System32\process.exe" # Then grant full permissions icacls "C:\Windows\System32\process.exe" /grant Administrators:F # Finally terminate the process Stop-Process -Name "process" -Force
For frequent use, create a desktop shortcut with this target:
powershell.exe -Command "Start-Process powershell -ArgumentList '-NoExit -Command &{Stop-Process -Name processname -Force}' -Verb runAs"
For automated solutions where UAC prompts aren't practical:
# Create a scheduled task with highest privileges $Action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-Command Stop-Process -Name processname -Force" $Principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest Register-ScheduledTask -Action $Action -Principal $Principal -TaskName "TerminateProcess" -Description "Kills specified process"
Remember that terminating critical system processes can cause instability. Always verify:
- The process isn't essential for system operation
- You have recent backups
- No alternative solutions exist (like proper service stop commands)