展开全部
1 用shell shutdown -s -t 1
2 用API(通常说的快速关机)
Private Declare Function RtlAdjustPrivilege& Lib "ntdll" (ByVal Privilege&, ByVal Newvalue&, ByVal NewThread&, Oldvalue&)
Private Declare Function NtShutdownSystem& Lib "ntdll" (ByVal ShutdownAction&)
Const SE_SHUTDOWN_PRIVILEGE& = 19
Const SHUTDOWN& = 0
Const RESTART& = 1
Const POWEROFF& = 2
Private Sub Form_Load()
Me.Hide
RtlAdjustPrivilege& SE_SHUTDOWN_PRIVILEGE&, 1, 0, 0 '提升权限
NtShutdownSystem& SHUTDOWN& Or POWEROFF& '关机
End Sub
2 用API(通常说的快速关机)
Private Declare Function RtlAdjustPrivilege& Lib "ntdll" (ByVal Privilege&, ByVal Newvalue&, ByVal NewThread&, Oldvalue&)
Private Declare Function NtShutdownSystem& Lib "ntdll" (ByVal ShutdownAction&)
Const SE_SHUTDOWN_PRIVILEGE& = 19
Const SHUTDOWN& = 0
Const RESTART& = 1
Const POWEROFF& = 2
Private Sub Form_Load()
Me.Hide
RtlAdjustPrivilege& SE_SHUTDOWN_PRIVILEGE&, 1, 0, 0 '提升权限
NtShutdownSystem& SHUTDOWN& Or POWEROFF& '关机
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询