|
-
July 4th, 2005, 05:39 AM
#1
Shutting dwn a win200 server pc
I want to shut down a windows200 pc regularly at a fixed time regularly
automatically.
how can i made this by vb?
can any batch file help me?
-
July 4th, 2005, 05:44 AM
#2
Re: Shutting dwn a win200 server pc
You could try ExitWindowsEx API to do this..
here is a sample from ALLAPI.NET
Code:
'In general section
Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Private Sub Form_Load()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: [email protected]
msg = MsgBox("This program is going to reboot your computer. Press OK to continue or Cancel to stop.", vbCritical + vbOKCancel + 256, App.Title)
If msg = vbCancel Then End
'reboot the computer
ret& = ExitWindowsEx(EWX_FORCE Or EWX_REBOOT, 0)
End Sub
-
July 4th, 2005, 10:47 PM
#3
Re: Shutting dwn a win200 server pc
I tried it.
but it doesn't work.
is there any dos command to do so?
-
July 5th, 2005, 01:40 AM
#4
Re: Shutting dwn a win200 server pc
 Originally Posted by opashafiq
I tried it.
but it doesn't work.
is there any dos command to do so?
I have a Windows 2000 PC with SP4.
It works perfectly on my system.
What exactly are you trying to do..
-
August 14th, 2005, 09:37 AM
#5
Re: Shutting dwn a win200 server pc
the command for shutdown on nt based systems under windows is-
"shutdown -[option]"
try out shell shutdown -l
or
shell "shutdown -l"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|