Is there any DOS command to reboot computer ?
登录 | 论坛导航 -> 华新鲜事 -> 技术の宅 | 本帖共有 15 楼,当前显示第 11 楼 : 从楼主开始阅读 : 本帖树形列表 : 返回上一页
作者:flu (等级:4 - 马马虎虎,发帖:478) 发表:2004-06-16 14:18:11  11楼 
how does your code look like?API Function Declare Function ExitWindowsEx Lib "user32" Alias "ExitWindowsEx" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long use EWX_REBOOT for uFlags. BTW, the calling process must have SE_SHUTDOWN_NAME privilege in order for this to work.
my code:
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()
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)
Unload Me
End Sub

what is SE_SHUTDOWN_NAME privilege? blur~
hh
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表

本帖共有 15 楼,当前显示第 11 楼,本文还有 N-1 层楼,要不你试试看:点击此处阅读更多 >>



请登录后回复:帐号   密码