How to programmatically schedule a task to start when Windows shuts down?

This is almost the same as Planning a task to run when windows close , except that I need to do this programmatically . In addition, I need a guarantee that when the script starts, no application can cancel the shutdown anymore .

Is it possible?

Thank.

Update with little context . My company is developing a kind of antivirus program designed to protect Internet banking customers. Naturally, this program is a frequent target for malware, so it should be protected from uninstallation. The first thing he does is to introduce himself into the system process so that he cannot be killed without bringing his entire system.

One of the typical ways to uninstall such a program is to mark it for deletion at the next shutdown, so our application actively monitors the registry keys that process these pending deletions and deletes them.

I was recently tasked with writing - about irony - an uninstaller for our application. The uninstaller should, of course, delete the files, so it must bypass everything that we ourselves created. It must be compatible with older versions, so changing security mechanisms is not an option.

+3
source share
1 answer

Since you need to support older versions that do not have the ability to add a backdoor for future use, you probably have to boot the machine to an alternative OS so that your files do not load at boot, then you can safely delete them. Look at the inclusion of a free third-party DOS- a clone or even a small version of Linux in the uninstall process.

+2

Source: https://habr.com/ru/post/1769019/


All Articles