當前位置:首頁 » 編程軟體 » vbs按鍵腳本

vbs按鍵腳本

發布時間: 2023-08-04 17:42:38

① 有誰幫我弄個重復按鍵VBS腳本

DimWshShell,Path,i
SetWshShell=WScript.CreateObject("WScript.Shell")
dowhiletrue
WshShell.SendKeys"%"
WshShell.SendKeys"%"
wscript.sleep30000
loop

代碼如上 死循環沒30秒執行一次按鍵

② vbs,求按某個按鍵讓vbs的腳本停止的代碼,謝謝。可以加入下的代碼中

// VBS是不能通過鍵盤來實現交換數據的,或者非常麻煩,不如你試試按鍵精靈,和VBS的語言格式一樣,但是比vbs實現的功能要更多。

Sub woniu1
n = 0
Do
Dim objws
set objws=WScript.CreateObject("wscript.shell")
RunApp "mouse.exe"
n = n + 1
If n = 2 Then
Exit Do
End If
Loop
End Sub
Sub woniu2
n = 0
Do
Dim objws
set objws=WScript.CreateObject("wscript.shell")
RunApp "mouse.exe"
n = n + 1
If n = 2 Then
Exit Do
End If
Loop
End Sub
Sub xtay2
KeyPress "Ctrl", 1
Delay 100
Key=WaitKey()
If Key = 49 or Key = 97 Then
Call woniu1
ElseIf Key = 50 or Key = 98 Then
Call woniu2
ElseIf Key = 35 Then
MsgBox"您已中止"
ExitScript
Else
Delay 500
Call xtay3
End IF
End Sub
Sub xtay3
KeyPress "Ctrl", 1
Delay 100
Key=WaitKey()
If Key = 49 or Key = 97 Then
Call woniu2
ElseIf Key = 50 or Key = 98 Then
Call woniu1
ElseIf Key = 35 Then
MsgBox"您已中止"
ExitScript
Else
Delay 500
Call xtay2
End IF
End Sub
Call xtay3

③ 如何編寫wincc 按鈕的vbs腳本

i/o域的屬性中輸入輸出屬性連接變數a,
按鈕腳本:事件中 點擊左鍵
Dim a

set a=hmiruntime.tags("a")
a.read
hmiruntime.tags("b").write a.value
你試試

熱點內容
資料庫的欄位命名規則 發布:2025-02-05 13:53:16 瀏覽:683
固定ip自建伺服器訪問 發布:2025-02-05 13:53:03 瀏覽:740
快速獲取文件夾沒文件 發布:2025-02-05 13:52:19 瀏覽:871
伺服器主機如何家用 發布:2025-02-05 13:52:15 瀏覽:99
安卓應用如何刪除自動下載 發布:2025-02-05 13:52:15 瀏覽:660
c語言switch語句用法 發布:2025-02-05 13:49:16 瀏覽:936
騰訊緩存不了的動畫片怎麼辦 發布:2025-02-05 13:49:12 瀏覽:130
access資料庫調用 發布:2025-02-05 13:45:01 瀏覽:49
如何查詢伺服器所有電腦名 發布:2025-02-05 13:21:38 瀏覽:150
我的世界ec伺服器up主稱號怎麼獲得 發布:2025-02-05 13:21:15 瀏覽:913