Is there any DOS command to reboot computer ?
登录 | 论坛导航 -> 华新鲜事 -> 技术の宅 | 本帖共有 15 楼,当前显示第 12 楼 : 从楼主开始阅读 : 本帖树形列表 : 返回上一页
作者:Flying (等级:18 - 华新水车,发帖:16849) 发表:2004-06-16 15:35:00  12楼 
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~
Check out the sample code there:
http://www.vbaccelerator.com/home/VB/Tips/How_to_Shutdown_the_System_in_Windows_9x_and_NT/article.asp

Note that there are a lot other stuff in the sample code. But what you should pay attention to is the part there the current process's privilege tokens are checked, and adjusted, in order to enable the process to shutdown the OS.
Flying @way 吳穎暉
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表

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



请登录后回复:帐号   密码