It is really possible. However, your example is probably not the best to describe a general problem. Windows has session events that applications can listen to, and shutdown is one of them . And in the end, shutdown.exe is not the only application that can ask Windows to shut down.
In general, however, applications "listening" for executable commands will have to integrate closely with the operating system. You can imagine that anti-virus software does just that and much more to prevent the execution of "bad" programs. I am not familiar with Windows technology, but I assume that this requires a Windows system call that executes binary files. Of course, this will require "administrative" permissions, and you may even need to write a kernel module.
user405725
source share