| > Can anybody tell me if there is a way to gracelessly reboot a dying|
> 95 box? In other words, I need a routine that circumnavigates all the
> tidying up that Windows usually does, and just boots the system. No
> prompts, no saving unsaved work or clearing caches - just a clean reboot.
> My reason for posting this is that I'm running some lengthy legacy code on
> an old Win95 box (not mission-critical before you ask), and due to
> problems it periodically crashes. This is a pain, as it's a
> remotely-managed box. It would be nice to be able to send it a UDP
> for example, and have it reset itself.
> Actually I understand that this 'feature' is available in Back Orifice :o)
> Anyone know how it's done please?
> Please mail replies as well as posting....
OpenProcessToken(GetCurrentProcess,TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY,
LookupPrivilegeValue(niL, 'SE_SHUTDOWN_NAME', tkp.Privileges.Luid);
tkp.PrivilegeCount := 1;
tkp.Privileges.Attributes := SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken, False, tkp, 0, ptkp, i);
1:ExitWindowsEx(EWX_SHUTDOWN or EWX_FORCE, 0);
2:ExitWindowsEx(EWX_REBOOT or EWX_FORCE, 0);