Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shutdown Windows from vfp
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00257880
Message ID:
00257941
Views:
17
>So The command should be the following ?
>
>=ExitWindowsEx(EWX_POWEROFF + EWX_FORCE, 0)
>---OR---
>=ExitWindowsEx(12, 0)
>
>It Does'nt work for me, It only logs off my morkstation.


(1) Is APM enabled? If not, it won't work. EWX_SHUTDOWN + EWX_FORCE (5) will consistently force a shutdown, regardless of APM settings, under Win98.

(2) I've seen this not work in NT systems because of process privileges; it works reliably from Win98 (I've already tried it here on a Win98 system with APM to make sure.) The logoff is the behavior most often seen from an NT system. It may be that other software, possibly an AV app, is intercepting this, but again, without knowing what your system configuration is, I can't be sure.

>
>Any idea ?
>
>>
>>You need both the EWX_FORCE and EWX_SHUTDOWN values (EWX_SHUTDOWN + EWX_FORCE), and you must have ACPI/APM enabled on the station if you want it to actually power off the system and then use EWX_POWEROFF + EWX_FORCE.)
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform