>Hi, is there a way to turn off my computer from inside a Visual Foxpro 6 aplication?
>
There's a Windows API call that can do this (ExitWindowsEx()) which is described here in the UT FAQ. You can reliably shut down Win9x systems using it, however, processes need a specific permission (SE_SHUTDOWN_NAME) to be able to do more than log out the current user under NT and Win2K; if the user has adequate privileges, the SE_SHUTDOWN_NAME privilege can be enabled using the AdjustTokenPrivileges() API call. Using AdjustTokenPrivileges() is not trivial in VFP; some sample C code that demonstrates its use can be found at
http://www.mvps.org/win32/processes/rb.c