標(biāo)題: 用vb寫(xiě)電腦命令程序(原創(chuàng)) [打印本頁(yè)] 作者: xueren 時(shí)間: 2013-7-13 00:19 標(biāo)題: 用vb寫(xiě)電腦命令程序(原創(chuàng)) 有時(shí)候,電腦關(guān)機(jī)很慢.原因是系統(tǒng)調(diào)用關(guān)機(jī)命令時(shí),沒(méi)有直接調(diào)用運(yùn)行中的shutdown命令,要經(jīng)過(guò)"很大工程"!!!
所以,下面我們用VB編寫(xiě)一個(gè)直接調(diào)用shutdown命令的程序,關(guān)機(jī)速度大大加快!!!!
VB代碼:
Private Sub Command1_Click()
Shell "shutdown -l" ’-l 是shutdown 的一個(gè)參數(shù) 意思是注銷用戶
End Sub
Private Sub Command2_Click()
Shell "shutdown -R -t 0" ’-r 是重啟 等待時(shí)間為0秒
End Sub
Private Sub Command3_Click()
Shell "shutdown -S -t 0" ’-s 是關(guān)閉系統(tǒng)
End Sub
Private Sub Command4_Click()
Unload Me ’卸載窗體
End Sub