Thank you for your reply. This isn't a lack of display refresh. Task manager still shows the process running with 0% CPU and about 5 MB RAM. This has been an issue for years spanning Server 2016 - 2022 and perhaps even more.
Disk Cleanup (cleanmgr) won't close at end until the mouse moves
I have a scheduled task on my Windows servers to run Disk Cleanup via "cleanmgr /sagerun:1" and it works just fine except it never ends. Eventually it hits the time limit I set in Task Scheduler and its forced close but this seams like a bug. If I run it from the command line in an interactive session, I think I see the problem. Disk Cleanup runs but when the progress bar gets to 100%, it just hangs. Simply moving the mouse gets it to close as it should. I'm thinking this is why it won't end on it's own when run as a scheduled task - there's no mouse to move.
Windows for business | Windows Server | User experience | Remote desktop services and terminal services
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
5 answers
Sort by: Most helpful
-
Anonymous
2024-09-30T17:06:43+00:00 -
Anonymous
2024-12-13T07:09:12+00:00 We've been experiencing this issue as well with our Windows 11 Pro workstations. We run an automated batch script with this:
START /Wait /D "%System32%\" "Running Disk Cleanup..." cleanmgr.exe /d %systemroot% /sagerun:1When Disk Cleanup reaches 100% then it just halts and does nothing until someone moves the mouse pointer. We can wait a long time with Disk Cleaner showing "100%" completion, and it just won't close. But then move the mouse pointer one centimeter and suddenly Disk Cleaner closes properly. Since this behavior consistently occurs on just about every Windows 10 and Windows 11 workstation that I've ever come across, this is most certainly a bug in Disk Cleanup.
Best Regards,
Chris
Note: We need to use /sageset:1 to set our custom settings and /sagerun:1 so that cleanmgr.exe runs with those same settings. The /verylowdisk parameter is no viable alternative since that is intended to run cleanmgr.exe only with default settings.
-
Anonymous
2024-11-22T09:25:06+00:00 Same behavior. It gets to the end of cleaning up thumbnails and then it just hangs until I move the mouse.
-
Anonymous
2024-11-22T08:13:58+00:00 Hello,
This interaction may be related to the cleanmgr command itself, I'm not sure about the task you specified earlier for /sageset: n. You might consider using automated batch scripts for Disk Cleanup without interaction.
If the problem persists, given that it involves Windows commands, I recommend directing your question to the following forums:
Windows Server - Microsoft Q&A
The technical experts of this platform will provide more precise and efficient solutions according to your problem environment.
Reference:
Best regards,
Jacen
-
Anonymous
2024-09-30T16:56:55+00:00 Hello,
Thank you for posting in the Microsoft community forum.
This phenomenon may be due to the graphical user interface (GUI) not automatically updating after completion, resulting in an application that appears to be in a suspended state.
You are advised to check the Windows update first to improve system compatibility and stability.
Also, try to repair system files using the System File Checker (SFC):
sfc /scannowWait for the scan to complete and restart the computer.
I hope this helps. If you have any follow-up questions, please contact us.
Best regards
Jacen