PDA

Click to See Complete Forum and Search --> : Shutting Down Windows NT


Lloyd
Nov 11th, 1999, 01:32 AM
Hi out there! I am working on a program that will run at the end of the day and then shut down Windows NT when finished. I tried to use the code below to shut windows down but literly nothing happens. Does anyone have any ideas?

Thanks,
Lloyd


'General Declarations
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Private Const EXIT_LOGOFF = 0
Private Const EXIT_SHUTDOWN = 1
Private Const EXIT_REBOOT = 2


Public Sub ShutDown(ByVal uFlags As Long)
Call ExitWindowsEx(uFlags, 0)

End Sub


Private Sub cmdRun_Click()
Call ShutDown(1)

End Sub

Jhd.Honza
Nov 11th, 1999, 01:36 AM
See http://www.vb-world.net/ubb/Forum1/HTML/010222.html (sending data trough Winsock - they are trying to shut down NT)