Access Denied when trying to kill stuck processes


spapakons

Well-known member
Guru
VIP
Local time
5:23 AM
Posts
8,123
Location
Athens
OS
Windows 11 Pro 23H2 (5699), 25H2 (8655)
Hello!

It doesn't happen often, but occassionaly File Explorer will be very slow and it might eventually get stuck. After a first attempt to End Task from Task Manager fails, then it locks and any other attempt fails with an "Access denied" message. Any other application that attempts to access files, such using an "Open file" or "Save as" dialog will also get stuck with the same symptoms, "Access Denied" when trying to End Task from Task Manager. Since that only happens rarely, it is not important to find out why it happens, I just want to know if there is any way to force the application to quit and terminate. I have added the "kill unresponding tasks" to File Explorer context menu with Winareo Tweaker. When I do that it opens a command prompt and executes the relevant code to kill all stuck applications, but this also fails with the "Access Denied" error. Any other workaround? If I let the computer finish whatever it is doing and stays idle for very long, it might eventually kill the stuck processes, but most of the times I have to force a reset from the button. Is there any utility or command prompt code that can immediately force all stuck applications to quit and terminate irrespectively of the access rights?

Thanks in advance.
 
Windows Build/Version
Windows 11 Pro v23H2 build 22631.3085

My Computers My Computers

  • At a glance

    Windows 11 Pro 23H2 (5699), 25H2 (8655)Mobile DualCore Intel Core 2 Duo T7250, 2000 MHz4GBMobile Intel(R) GMA 4500M (Mobile 4 series)
    OS
    Windows 11 Pro 23H2 (5699), 25H2 (8655)
    Computer type
    Laptop
    Manufacturer/Model
    Acer Extensa 5630EZ
    CPU
    Mobile DualCore Intel Core 2 Duo T7250, 2000 MHz
    Motherboard
    Acer Extensa 5630
    Memory
    4GB
    Graphics Card(s)
    Mobile Intel(R) GMA 4500M (Mobile 4 series)
    Sound Card
    Realtek ALC268 @ Intel 82801IB ICH9 - High Definition Audio Controller
    Monitor(s) Displays
    1
    Screen Resolution
    1280x800
    Hard Drives
    Samsung SSD 850 EVO 250GB SATA Device (250 GB, SATA-III)
    Internet Speed
    VDSL 50 Mbps
    Browser
    MICROSOFT EDGE
    Antivirus
    WINDOWS DEFENDER
    Other Info
    Legacy MBR installation, no TPM, no Secure Boot, no WDDM 2.0 graphics drivers, no SSE4.2, cannot get more unsupported ;) This is only my test laptop. I had installed Windows 11 here before upgrading my main PC. For my main PC I use everyday see my 2nd system specs.
  • At a glance

    Windows 11 Pro v25H2 (build 26200.8655)Intel Core-i7 3770 3.40GHz s1155 (3rd generat...2x Kingston Hyper-X Blu 8GB DDR3-1600GIGABYTE GeForce RTX 3050 WINDFORCE OC V2 6GB...
    Operating System
    Windows 11 Pro v25H2 (build 26200.8655)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom-built PC
    CPU
    Intel Core-i7 3770 3.40GHz s1155 (3rd generation)
    Motherboard
    Asus P8H61 s1155 ATX
    Memory
    2x Kingston Hyper-X Blu 8GB DDR3-1600
    Graphics card(s)
    GIGABYTE GeForce RTX 3050 WINDFORCE OC V2 6GB (GV-N3050WF2OCV2-6GD)
    Sound Card
    Realtek HD audio (ALC887)
    Monitor(s) Displays
    Sony Bravia KDL-19L4000 19" LCD TV via VGA
    Screen Resolution
    1440x900 32-bit 60Hz
    Hard Drives
    WD Blue SA510 2.5 1000GB SSD as system disk, Western Digital Caviar Purple 4TB SATA III (WD40PURZ) as second
    PSU
    Thermaltake Litepower RGB 550W Full Wired
    Case
    SUPERCASE MIDI-TOWER
    Cooling
    Deepcool Gamma Archer CPU cooler, 1x 8cm fan at the back
    Keyboard
    Mitsumi 101-key PS/2
    Mouse
    Sunnyline OptiEye PS/2
    Internet Speed
    100Mbps
    Browser
    Microsoft Edge, Mozilla Firefox
    Antivirus
    Microsoft Windows Defender
    Other Info
    Legacy BIOS (MBR) installation, no TPM, no Secure Boot, WDDM 3.0 graphics drivers, WEI score 7.4
Try Process Explorer, make sure to open Process Explorer with Admin rights.
 

My Computer My Computer

At a glance

Windows 11AMD Ryzen 7 5700GMicron Technology DDR4-3200 16GBNVIDIA GeForce RTX 3060
OS
Windows 11
Computer type
PC/Desktop
Manufacturer/Model
HP Pavilion
CPU
AMD Ryzen 7 5700G
Motherboard
Erica6
Memory
Micron Technology DDR4-3200 16GB
Graphics Card(s)
NVIDIA GeForce RTX 3060
Sound Card
Realtek ALC671
Monitor(s) Displays
Samsung SyncMaster U28E590
Screen Resolution
3840 x 2160
Hard Drives
SAMSUNG MZVLQ1T0HALB-000H1
Thanks I will try it.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 23H2 (5699), 25H2 (8655)Mobile DualCore Intel Core 2 Duo T7250, 2000 MHz4GBMobile Intel(R) GMA 4500M (Mobile 4 series)
    OS
    Windows 11 Pro 23H2 (5699), 25H2 (8655)
    Computer type
    Laptop
    Manufacturer/Model
    Acer Extensa 5630EZ
    CPU
    Mobile DualCore Intel Core 2 Duo T7250, 2000 MHz
    Motherboard
    Acer Extensa 5630
    Memory
    4GB
    Graphics Card(s)
    Mobile Intel(R) GMA 4500M (Mobile 4 series)
    Sound Card
    Realtek ALC268 @ Intel 82801IB ICH9 - High Definition Audio Controller
    Monitor(s) Displays
    1
    Screen Resolution
    1280x800
    Hard Drives
    Samsung SSD 850 EVO 250GB SATA Device (250 GB, SATA-III)
    Internet Speed
    VDSL 50 Mbps
    Browser
    MICROSOFT EDGE
    Antivirus
    WINDOWS DEFENDER
    Other Info
    Legacy MBR installation, no TPM, no Secure Boot, no WDDM 2.0 graphics drivers, no SSE4.2, cannot get more unsupported ;) This is only my test laptop. I had installed Windows 11 here before upgrading my main PC. For my main PC I use everyday see my 2nd system specs.
  • At a glance

    Windows 11 Pro v25H2 (build 26200.8655)Intel Core-i7 3770 3.40GHz s1155 (3rd generat...2x Kingston Hyper-X Blu 8GB DDR3-1600GIGABYTE GeForce RTX 3050 WINDFORCE OC V2 6GB...
    Operating System
    Windows 11 Pro v25H2 (build 26200.8655)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom-built PC
    CPU
    Intel Core-i7 3770 3.40GHz s1155 (3rd generation)
    Motherboard
    Asus P8H61 s1155 ATX
    Memory
    2x Kingston Hyper-X Blu 8GB DDR3-1600
    Graphics card(s)
    GIGABYTE GeForce RTX 3050 WINDFORCE OC V2 6GB (GV-N3050WF2OCV2-6GD)
    Sound Card
    Realtek HD audio (ALC887)
    Monitor(s) Displays
    Sony Bravia KDL-19L4000 19" LCD TV via VGA
    Screen Resolution
    1440x900 32-bit 60Hz
    Hard Drives
    WD Blue SA510 2.5 1000GB SSD as system disk, Western Digital Caviar Purple 4TB SATA III (WD40PURZ) as second
    PSU
    Thermaltake Litepower RGB 550W Full Wired
    Case
    SUPERCASE MIDI-TOWER
    Cooling
    Deepcool Gamma Archer CPU cooler, 1x 8cm fan at the back
    Keyboard
    Mitsumi 101-key PS/2
    Mouse
    Sunnyline OptiEye PS/2
    Internet Speed
    100Mbps
    Browser
    Microsoft Edge, Mozilla Firefox
    Antivirus
    Microsoft Windows Defender
    Other Info
    Legacy BIOS (MBR) installation, no TPM, no Secure Boot, WDDM 3.0 graphics drivers, WEI score 7.4
Good luck!
 

My Computer My Computer

At a glance

Windows 11AMD Ryzen 7 5700GMicron Technology DDR4-3200 16GBNVIDIA GeForce RTX 3060
OS
Windows 11
Computer type
PC/Desktop
Manufacturer/Model
HP Pavilion
CPU
AMD Ryzen 7 5700G
Motherboard
Erica6
Memory
Micron Technology DDR4-3200 16GB
Graphics Card(s)
NVIDIA GeForce RTX 3060
Sound Card
Realtek ALC671
Monitor(s) Displays
Samsung SyncMaster U28E590
Screen Resolution
3840 x 2160
Hard Drives
SAMSUNG MZVLQ1T0HALB-000H1
If that doesn't work then you can always try PsKill.
 

My Computer My Computer

At a glance

Windows 11, Windows 10, Linux Fedora Cinnamon
OS
Windows 11, Windows 10, Linux Fedora Cinnamon
Thanks. I have Microsoft Edge open and I can browse to the tools you suggested, but I cannot download anything now since my computer is stuck. I can't restart either because it is busy rendering some video. I will just have to wait to finish before doing anything. Thanks for your replies though.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 23H2 (5699), 25H2 (8655)Mobile DualCore Intel Core 2 Duo T7250, 2000 MHz4GBMobile Intel(R) GMA 4500M (Mobile 4 series)
    OS
    Windows 11 Pro 23H2 (5699), 25H2 (8655)
    Computer type
    Laptop
    Manufacturer/Model
    Acer Extensa 5630EZ
    CPU
    Mobile DualCore Intel Core 2 Duo T7250, 2000 MHz
    Motherboard
    Acer Extensa 5630
    Memory
    4GB
    Graphics Card(s)
    Mobile Intel(R) GMA 4500M (Mobile 4 series)
    Sound Card
    Realtek ALC268 @ Intel 82801IB ICH9 - High Definition Audio Controller
    Monitor(s) Displays
    1
    Screen Resolution
    1280x800
    Hard Drives
    Samsung SSD 850 EVO 250GB SATA Device (250 GB, SATA-III)
    Internet Speed
    VDSL 50 Mbps
    Browser
    MICROSOFT EDGE
    Antivirus
    WINDOWS DEFENDER
    Other Info
    Legacy MBR installation, no TPM, no Secure Boot, no WDDM 2.0 graphics drivers, no SSE4.2, cannot get more unsupported ;) This is only my test laptop. I had installed Windows 11 here before upgrading my main PC. For my main PC I use everyday see my 2nd system specs.
  • At a glance

    Windows 11 Pro v25H2 (build 26200.8655)Intel Core-i7 3770 3.40GHz s1155 (3rd generat...2x Kingston Hyper-X Blu 8GB DDR3-1600GIGABYTE GeForce RTX 3050 WINDFORCE OC V2 6GB...
    Operating System
    Windows 11 Pro v25H2 (build 26200.8655)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom-built PC
    CPU
    Intel Core-i7 3770 3.40GHz s1155 (3rd generation)
    Motherboard
    Asus P8H61 s1155 ATX
    Memory
    2x Kingston Hyper-X Blu 8GB DDR3-1600
    Graphics card(s)
    GIGABYTE GeForce RTX 3050 WINDFORCE OC V2 6GB (GV-N3050WF2OCV2-6GD)
    Sound Card
    Realtek HD audio (ALC887)
    Monitor(s) Displays
    Sony Bravia KDL-19L4000 19" LCD TV via VGA
    Screen Resolution
    1440x900 32-bit 60Hz
    Hard Drives
    WD Blue SA510 2.5 1000GB SSD as system disk, Western Digital Caviar Purple 4TB SATA III (WD40PURZ) as second
    PSU
    Thermaltake Litepower RGB 550W Full Wired
    Case
    SUPERCASE MIDI-TOWER
    Cooling
    Deepcool Gamma Archer CPU cooler, 1x 8cm fan at the back
    Keyboard
    Mitsumi 101-key PS/2
    Mouse
    Sunnyline OptiEye PS/2
    Internet Speed
    100Mbps
    Browser
    Microsoft Edge, Mozilla Firefox
    Antivirus
    Microsoft Windows Defender
    Other Info
    Legacy BIOS (MBR) installation, no TPM, no Secure Boot, WDDM 3.0 graphics drivers, WEI score 7.4
You should not need any tools. Create a shortcut with target C:\Windows\System32\cmd.exe /c taskkill /im explorer.exe /f & start explorer.exe
Name it Kill Explorer (or whatever) Right click on the shortcut.
select properties
general tab-advanced-check run as administrator
shortcut tab- change the shortcut icon to one of your choosing
Apply-OK
You can pin this icon to taskbar or start menu.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 26200.8655i9-10900 10 core 20 threads32 gbnone-Intel UHD Graphics 630
    OS
    Windows 11 Pro 25H2 26200.8655
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 7080
    CPU
    i9-10900 10 core 20 threads
    Motherboard
    DELL 0J37VM
    Memory
    32 gb
    Graphics Card(s)
    none-Intel UHD Graphics 630
    Sound Card
    Integrated Realtek
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    2x1tb Solidigm m.2 nvme /External drives 512gb Samsung m.2 sata+2tb Kingston m2.nvme
    PSU
    500w
    Case
    MT
    Cooling
    Dell Premium
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    so slow I'm too embarrassed to tell
    Browser
    #1 Edge #2 Firefox
    Antivirus
    Defender+MWB Premium
  • At a glance

    Windows 11 Pro 24H2 26200.8457AMD Ryzen 7 6800U32 gbintegrated
    Operating System
    Windows 11 Pro 24H2 26200.8457
    Computer type
    PC/Desktop
    Manufacturer/Model
    Beelink Mini PC SER5
    CPU
    AMD Ryzen 7 6800U
    Memory
    32 gb
    Graphics card(s)
    integrated
    Sound Card
    integrated
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Crucial nvme
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    still too embarrassed to tell
    Browser
    Firefox
    Antivirus
    Defender
    Other Info
    System 3 is non compliant Dell 9020 i7-4770/24gb ram Win11 PRO 26200.8457
I am not sure but I think the "kill not responding processes" I have added to context menu does the same and fails with the "access denied" error. I will try next time, now I reset my computer back in the desktop fully functional. Thanks.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 23H2 (5699), 25H2 (8655)Mobile DualCore Intel Core 2 Duo T7250, 2000 MHz4GBMobile Intel(R) GMA 4500M (Mobile 4 series)
    OS
    Windows 11 Pro 23H2 (5699), 25H2 (8655)
    Computer type
    Laptop
    Manufacturer/Model
    Acer Extensa 5630EZ
    CPU
    Mobile DualCore Intel Core 2 Duo T7250, 2000 MHz
    Motherboard
    Acer Extensa 5630
    Memory
    4GB
    Graphics Card(s)
    Mobile Intel(R) GMA 4500M (Mobile 4 series)
    Sound Card
    Realtek ALC268 @ Intel 82801IB ICH9 - High Definition Audio Controller
    Monitor(s) Displays
    1
    Screen Resolution
    1280x800
    Hard Drives
    Samsung SSD 850 EVO 250GB SATA Device (250 GB, SATA-III)
    Internet Speed
    VDSL 50 Mbps
    Browser
    MICROSOFT EDGE
    Antivirus
    WINDOWS DEFENDER
    Other Info
    Legacy MBR installation, no TPM, no Secure Boot, no WDDM 2.0 graphics drivers, no SSE4.2, cannot get more unsupported ;) This is only my test laptop. I had installed Windows 11 here before upgrading my main PC. For my main PC I use everyday see my 2nd system specs.
  • At a glance

    Windows 11 Pro v25H2 (build 26200.8655)Intel Core-i7 3770 3.40GHz s1155 (3rd generat...2x Kingston Hyper-X Blu 8GB DDR3-1600GIGABYTE GeForce RTX 3050 WINDFORCE OC V2 6GB...
    Operating System
    Windows 11 Pro v25H2 (build 26200.8655)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom-built PC
    CPU
    Intel Core-i7 3770 3.40GHz s1155 (3rd generation)
    Motherboard
    Asus P8H61 s1155 ATX
    Memory
    2x Kingston Hyper-X Blu 8GB DDR3-1600
    Graphics card(s)
    GIGABYTE GeForce RTX 3050 WINDFORCE OC V2 6GB (GV-N3050WF2OCV2-6GD)
    Sound Card
    Realtek HD audio (ALC887)
    Monitor(s) Displays
    Sony Bravia KDL-19L4000 19" LCD TV via VGA
    Screen Resolution
    1440x900 32-bit 60Hz
    Hard Drives
    WD Blue SA510 2.5 1000GB SSD as system disk, Western Digital Caviar Purple 4TB SATA III (WD40PURZ) as second
    PSU
    Thermaltake Litepower RGB 550W Full Wired
    Case
    SUPERCASE MIDI-TOWER
    Cooling
    Deepcool Gamma Archer CPU cooler, 1x 8cm fan at the back
    Keyboard
    Mitsumi 101-key PS/2
    Mouse
    Sunnyline OptiEye PS/2
    Internet Speed
    100Mbps
    Browser
    Microsoft Edge, Mozilla Firefox
    Antivirus
    Microsoft Windows Defender
    Other Info
    Legacy BIOS (MBR) installation, no TPM, no Secure Boot, WDDM 3.0 graphics drivers, WEI score 7.4
You can get that error message if you're trying to terminate a process which already in the process of being terminating.

After a process has terminated, call to TerminateProcess with open handles to the process fails with ERROR_ACCESS_DENIED (5) error code.

Here's why it may have hung:

The terminated process cannot exit until all pending I/O has been completed or canceled. When a process terminates, its kernel object is not destroyed until all processes that have open handles to the process have released those handles.
Source: TerminateProcess function (processthreadsapi.h) - Win32 apps
 

My Computer My Computer

At a glance

Windows 11, Windows 10, Linux Fedora Cinnamon
OS
Windows 11, Windows 10, Linux Fedora Cinnamon
You should not need any tools.
Agreed, most of the time taskkill should be sufficient unless you don't have sufficient access rights.
 

My Computer My Computer

At a glance

Windows 11, Windows 10, Linux Fedora Cinnamon
OS
Windows 11, Windows 10, Linux Fedora Cinnamon
What if a task is in the process of being terminated but never quits for some reason? Isn't there a way to tell it "stop whatever you are doing and quit now", much like when shutting down the computer where you force quit.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 23H2 (5699), 25H2 (8655)Mobile DualCore Intel Core 2 Duo T7250, 2000 MHz4GBMobile Intel(R) GMA 4500M (Mobile 4 series)
    OS
    Windows 11 Pro 23H2 (5699), 25H2 (8655)
    Computer type
    Laptop
    Manufacturer/Model
    Acer Extensa 5630EZ
    CPU
    Mobile DualCore Intel Core 2 Duo T7250, 2000 MHz
    Motherboard
    Acer Extensa 5630
    Memory
    4GB
    Graphics Card(s)
    Mobile Intel(R) GMA 4500M (Mobile 4 series)
    Sound Card
    Realtek ALC268 @ Intel 82801IB ICH9 - High Definition Audio Controller
    Monitor(s) Displays
    1
    Screen Resolution
    1280x800
    Hard Drives
    Samsung SSD 850 EVO 250GB SATA Device (250 GB, SATA-III)
    Internet Speed
    VDSL 50 Mbps
    Browser
    MICROSOFT EDGE
    Antivirus
    WINDOWS DEFENDER
    Other Info
    Legacy MBR installation, no TPM, no Secure Boot, no WDDM 2.0 graphics drivers, no SSE4.2, cannot get more unsupported ;) This is only my test laptop. I had installed Windows 11 here before upgrading my main PC. For my main PC I use everyday see my 2nd system specs.
  • At a glance

    Windows 11 Pro v25H2 (build 26200.8655)Intel Core-i7 3770 3.40GHz s1155 (3rd generat...2x Kingston Hyper-X Blu 8GB DDR3-1600GIGABYTE GeForce RTX 3050 WINDFORCE OC V2 6GB...
    Operating System
    Windows 11 Pro v25H2 (build 26200.8655)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom-built PC
    CPU
    Intel Core-i7 3770 3.40GHz s1155 (3rd generation)
    Motherboard
    Asus P8H61 s1155 ATX
    Memory
    2x Kingston Hyper-X Blu 8GB DDR3-1600
    Graphics card(s)
    GIGABYTE GeForce RTX 3050 WINDFORCE OC V2 6GB (GV-N3050WF2OCV2-6GD)
    Sound Card
    Realtek HD audio (ALC887)
    Monitor(s) Displays
    Sony Bravia KDL-19L4000 19" LCD TV via VGA
    Screen Resolution
    1440x900 32-bit 60Hz
    Hard Drives
    WD Blue SA510 2.5 1000GB SSD as system disk, Western Digital Caviar Purple 4TB SATA III (WD40PURZ) as second
    PSU
    Thermaltake Litepower RGB 550W Full Wired
    Case
    SUPERCASE MIDI-TOWER
    Cooling
    Deepcool Gamma Archer CPU cooler, 1x 8cm fan at the back
    Keyboard
    Mitsumi 101-key PS/2
    Mouse
    Sunnyline OptiEye PS/2
    Internet Speed
    100Mbps
    Browser
    Microsoft Edge, Mozilla Firefox
    Antivirus
    Microsoft Windows Defender
    Other Info
    Legacy BIOS (MBR) installation, no TPM, no Secure Boot, WDDM 3.0 graphics drivers, WEI score 7.4
You'll need to investigate why that is the case, for example if another process is holding a handle to your terminating process, then you'll need to terminate that process first.
 

My Computer My Computer

At a glance

Windows 11, Windows 10, Linux Fedora Cinnamon
OS
Windows 11, Windows 10, Linux Fedora Cinnamon
Back
Top Bottom