>// shutdown.cpp >#include "stdafx.h" >#include "windows.h" > >void main(int argc, char* argv[]) >{ > ExitWindowsEx(EWX_SHUTDOWN, 0); >} > >Are you running under NT? If so, the user needs specific permissions to be able to force a shutdown from an application; you'll need to use AdjustTokenPrivileges to enable the SE_SHUTDOWN_NAME privilege. You'll also probably need to use both EWX_FORCE and EWX_SHUTDOWN to avoid dialogs in any case.