Search Tools Links Login

Absolute Windows Shut Down


When you use the ExitWindowsEx API to reboot the system under Windows NT and Windows 2000, the machine does not reboot.
'CAUSE
In order to programmatically reboot a Windows NT or Windows 2000 system, the process requires the SE_SHUTDOWN_NAME privilege. By default, Visual Basic applications do not have this privilege and therefore will not reboot the machine.
In order to get ExitWindowsEx API to reboot the system under Windows NT or Windows 2000, the SE_SHUTDOWN_NAME privilege must be set.
This Code Shows you the best way to reboot force restart or shut down a PC

Original Author: Arjang

Assumptions

N/A

Side Effects

Be carefull It will restart the machine.

API Declarations

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

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 64 times

Categories

Visual Basic 6

Attachments

CODE_UPLOAD9571932000.zip
Posted: 9/3/2020 3:45:00 PM
Size: 3,150 bytes


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.