How to Move the mouse using VBScript

前端 未结 2 878
鱼传尺愫
鱼传尺愫 2021-01-22 14:38

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 workin

2条回答
  •  Happy的楠姐
    2021-01-22 15:26

    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 Position | yyy = y Position

    The only disadvantage is that you need Microsoft Excel to run this script...

    Hope I could help you

提交回复
热议问题