当前位置:首页 » 编程软件 » 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-07-01 16:11:41 浏览:74
走心机编程教学 发布:2025-07-01 15:34:30 浏览:222
安卓系统哪个bug最少 发布:2025-07-01 15:34:16 浏览:783
不是安卓怎么让时间显示在屏幕上 发布:2025-07-01 15:20:54 浏览:516
黄岩数控编程培训 发布:2025-07-01 15:12:30 浏览:981
迷宫寻路算法 发布:2025-07-01 15:12:29 浏览:546
微信视频缓存目录 发布:2025-07-01 14:58:59 浏览:396
vmwarelinux教程 发布:2025-07-01 14:50:33 浏览:499
名词解释预算法 发布:2025-07-01 14:34:36 浏览:920
iis文件拒绝访问 发布:2025-07-01 14:34:20 浏览:571