如何使用VBScript移动鼠标 [英] How to Move the mouse using VBScript
问题描述
我正在尝试使用VBScript移动鼠标.我尝试使用Sendkeys "{CLICK LEFT , x , y}"
和Sendkeys "{MOVETO, 10 , 20}"
,但是它不起作用,我也尝试使用MouseKeys,所以我可以用键盘移动它,因此使用Sendkeys
来激活它,但是它也没有用(鼠标键小键盘没有移动鼠标).我已经尝试了所有我知道的东西以及可以在其他地方研究的东西,所以现在我希望你们中的一个可以为我回答这个问题. thxs
I am trying to move the mouse using VBScript. I tried to use Sendkeys "{CLICK LEFT , x , y}"
and Sendkeys "{MOVETO, 10 , 20}"
but it isn't working i also tried to use MouseKeys, so i could move it with the keyboard and therefore use Sendkeys
to activate it but it also did not work (the mousekeys numpad is not moving the mouse). I've tried everything I know and what i could research elsewhere, so now I hope one of you can answer this for me. thxs
推荐答案
移动鼠标的一种可能方法是:
One possible way to move the mouse is:
Dim Excel: Set Excel = WScript.CreateObject("Excel.Application")
Excel.ExecuteExcel4Macro "CALL(""user32"",""SetCursorPos"",""JJJ"",""xxx"",""yyy"")"
-> xxx = X位置 | yyy = y位置
-->xxx = X Position | yyy = y Position
唯一的缺点是您需要Microsoft Excel才能运行此脚本...
The only disadvantage is that you need Microsoft Excel to run this script...
希望我能帮助您
这篇关于如何使用VBScript移动鼠标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!