VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Absolute Windows Shut Down

Arjang  (3 Submissions)   Windows API Call/Explanation   Visual Basic 3.0   Advanced   Wed 3rd February 2021

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

Assumes
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

Rate Absolute Windows Shut Down (16(16 Vote))

Download Absolute Windows Shut Down

Absolute Windows Shut Down Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters