VB Code:
Private Const EWX_REBOOT As Long = 2 Private Declare Function ExitWindowsEx Lib "user32" (ByVal dwOptions As Long, ByVal dwReserved As Long) As Long ' REBOOT THE COMPUTER lngResult = ExitWindowsEx(EWX_REBOOT, 0&)
Printable View
VB Code:
Private Const EWX_REBOOT As Long = 2 Private Declare Function ExitWindowsEx Lib "user32" (ByVal dwOptions As Long, ByVal dwReserved As Long) As Long ' REBOOT THE COMPUTER lngResult = ExitWindowsEx(EWX_REBOOT, 0&)
hey, I love all of the snippets you post here, there great. But with this, and shutdown windows, they dont work with XP. Is this something known, and is there other code I can use for these commands, or am I just mistyping something maybe?
They do not work because XP is NT based. You must adjust token privileges for the process. Go here to see the snippet.
http://www.jaredshelp.com/article65.html
Thanks
Jared