Gold mine of Visual C++ tricks!
Posts tagged shutdown remote pc
How to shutdown or restart a remote machine?
61338 days
![]()
You can restart the machine on your table by simply pressing the restart button. But what about a remote machine? For instance, in cable-tv broadband networks, windows machines can be deployed as industrial pc’s which are located several kilometers away from the central server. So its not possible to reach the hardware and restart the pc if needed. So how can you shutdown or restart a remote pc?
![]()
You can use the function – InitiateSystemShutdown(). It will initiate the shutdown or restart process in the specified remote machine. See the following code snippet.
// Restart remote machine - RemotePC01
InitiateSystemShutdown( _T("RemotePC01"), // Machine Name.
_T("You are going to be restarted"),
5000, // timeout
TRUE, // Forcefully close applications.
TRUE ); // Restart the PC
![]()
If you need to abort the shutdown process, you can call AbortSystemShutdown().
![]()
Targeted Audience – Beginners.