Hallo Alexander,
habe mir gerade den Code angesehen: So wird das nichts, dir fehlen einfach nur die Privilegien.
In der Windows
SDK-Hilfe heißt es zu
InitiateSystemShutdown
Zitat:
To shut down the local computer, the calling process must have the SE_SHUTDOWN_NAME privilege. To shut down a remote computer, the calling process must have the SE_REMOTE_SHUTDOWN_NAME privilege on the remote computer. By default, users can enable the SE_SHUTDOWN_NAME privilege on the computer they are logged onto, and administrators can enable the SE_REMOTE_SHUTDOWN_NAME privilege on remote computers.
Also frisch ans Werk, dann wird es auch