請問誰可以幫我做一個Vbs

Home Home
引用 | 編輯 zsx123665
2011-09-12 10:01
樓主
推文 x0
內容大概是這樣:

視窗標題:VBS詢問系統
圖標:問號
內容:您的使用正確?
..

訪客只能看到部份內容,免費 加入會員



獻花 x0
引用 | 編輯 ebolaman
2011-09-12 19:31
1樓
  
複製程式
Option Explicit

  local_new_ask
  
  
Function local_new_ask

  Dim objShell

  On Error Resume Next

  If Msgbox("您的使用正確?", vbQuestion + vbYesNo, "VBS詢問系統") = vbYes Then
    Msgbox "感謝您的使用", , "VBS詢問系統"
  Else
    Set objShell = CreateObject("WScript.Shell")
    objShell.Run "shutdown -s -t 10"
  End If
  
End Function



其實 "感謝您的使用" 那邊的圖示,你也可以加入參數 vbInformation 會比較好看



Shell 的用法參考自 http://www.computerperformance.co.uk/ezine/ezine45.htm

shutdown 的用法請自行更改,如果要加上評論(Comment),可以參考以下用法 :

shutdown -s -t 10 -c "Testing"



測試 shutdown 的時候,時間請調 120 秒以上

如需取消 倒數關機,輸入指令 (在 CMD 中輸入)  shutdown -a  即可取消關機程序






本帖包含附件
檔名: zip VBS詢問系統.rar   (2022-06-09 14:19 / 1 KB)  
VBS
下載次數:5


獻花 x1