This looks like it was I had in mind but I can't seem to make it work. Where do I place this code? I tried putting it in a stand-alone prg and doing that, but nothing happens.
>>Would someone please describe in some detail a straight forward way of causing NT Server to reboot from within a VFP 5 .app?
>
>It can be done with a simple API call, however, being able to do it is not necessarily trivial, because the application may not be running with the needed privileges that would allow you to do more than log out the current user from NT. Assuming that the user has adequate privileges, the ExitWindowEx() API call can force a restart of NT Server, however, in addition to the issue of required privileges, there's also the issue of how to log ion with no user (or perhaps a user who doesn't have a valid account on the NT Server) after restart. While an automatic login can be set up using a couple of registry entries, this basically violates the security of the NT Server machine, since the registry values could be read by a less-privileged user.
>
>This also assumes that you're trying to reset the machine you're running the application on; remote reboots are considerably more complex.
>
>
DECLARE INTEGER ExitWindowsEx IN WIN32API ;
> INTEGER uFLags, ;
> INTEGER dwReserved
>#DEFINE EWX_REBOOT 2
>#DEFINE EWX_FORCE 4
>=ExitWindowsEx(EWX_REBOOT + EWX_FORCE, 0)