注册 登录
编程论坛 VB6论坛

用vb定时关机,

baron1234567 发布于 2014-01-16 12:39, 748 次点击
Private Sub Command2_Click()
b = InputBox("请输入关机的时间,例如:10:30", "输入时间")
Shell "c:\windows\system32\cmd.exe /c              shutdown -s -t"

End Sub
  
如何利用inputbox将输入的数字放到中间  例如10:30 要怎么做?、急求!
5 回复
#2
baron12345672014-01-16 12:39
求啊!!!
#3
Artless2014-01-17 11:18
到中间?
#4
风吹过b2014-01-17 11:41
用 AT 命令好啦。

用二行命令:  
Shell  "at /delete /yes"                 '删除所有计划任务,如果你认为不需要删除,或者有其它计划任务不能删,那么去掉这行
shell "at " & b &  " shutdown -s -t "    '设置计划关机时间

以上命令仅支持 WINXP 、WIN7 ,不支持 WIN8
#5
风吹过b2014-01-17 11:43
要么你自己用计时器自己走时间,到了时间才发出执行关机命令的命令行。
1