Closed realgooseman closed 8 months ago
Hey there, unfortunately, this is a Windows thing, and there's nothing I can do about it. Windows shouldn't be deleting tasks like that. Maybe someone on a Microsoft forum or Reddit can help you out.
I could make the app more reliable for Windows by digitally signing the code, but that would cost me around $300 a year, which is a bit tough for a free app.
Hello,
I experienced the same problem and found a way to fix it.
The trick is to create/edit the task and set the active user/group for the task to the built-in "Users" group. After that, the program launched at start silently with no UAC window. Also, the program seemed to work well, I can optimize RAM and get the notification of how much was free'd.
However, when I edit the original task that's created by the program, or I delete it and create another with the same name, while I still have the "Run at startup" checked on the options of the program, my task is deleted and replaced by another created by the program. So, what I did is that I unchecked "Run at startup" from the program's options, and created my task with a different name, and now all is good. I tried several times after several reboots, it keeps working.
I cloned the repo and looked at how the task is created. The fix is pretty easy. I wanted to do it myself and make a pull request but I'm on Windows 11 with Visual Studio 2022, I couldn't install the SDK/Target Pack for .NET 4.0. So, I'm just sharing my solution in here for someone else to implement.
The task is created via command line, all that's needed is to edit the command line and add the "/RU" parameter with the value "[MachineName]\Users" (maybe plain "Users" could work too).
I discovered this trick while I was wondering why WinMemoryCleaner gets the UAC check while other programs that run at startup for me and require high privileges get no UAC check, I noticed they all used the "Users" group. So, it is a proven method used by antiviruses, system cleaners, disk optimizers etc.
I only checked this on Windows 11, but I think this fix is worth being implemented because it will either solve the problem for everyone, or just Windows 11 users haha.
That's all folks!
Thanks. I'll check it out. I also use 2022 on Win 11. If you're interested, there's a fix I do to make 4.0 work.
Thanks for the link!
It's a shame we can't target .NET 4.0 out of the box, true, it's old, end of life, but there are still old systems that didn't migrate to newer Windows or .NET versions. There are security risks of course for the people who didn't migrate, but developers who want to target the largest pool of systems should still be able to build for older technology. This is almost a philosophical question...
Checklist
App version
2.8
Problem you are trying to solve
Every time I launch my Windows 11 system, WinMemoryCleaner shows an annoying UAC window to give it admin rights.
Suggested solution
Is it possible to hide the UAC window on launch and still give admin rights to the WinMemoryCleaner ?
I tried this already but it doesn't work :
I created a task in task scheduler that launches WinMemoryCleaner.exe on startup with with maximum permissions, it DOES work after the first reboot but then that task gets deleted for some reason.
I excluded WinMemoryCleaner.exe file and process from Windows Defender as well.
Is there another solution ?
Screenshots / Drawings / Technical details
No response