Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reboot in WinXP

Status
Not open for further replies.

mwf222

Programmer
Joined
Mar 28, 2003
Messages
2
Location
US
The following brief VB program has worked effectively to reboot Windows 98 (using the Windows scheduler) - but it doesn't work on Windows XP (Home) - Can anyone help?
-----------------------------------------------------------
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_LOGOFF = 0
Const EWX_FORCE = 4

Private Declare Function ExitWindowsEx Lib "user32" _
(ByVal uFlags As Long, ByVal dwReserved As Long) As Long

Private Sub Form_Load()
ExitWindowsEx EWX_REBOOT, 0
Unload Me
End
End Sub
-----------------------------------------------------------
 
On NT/2000/XP platforms the calling process must have SE_SHUTDOWN_NAME privilege.

See the Platform SDK documentation for ExitWindowsEx

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top