Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Move the mouse using VBScript

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

like image 247
TheGamerLord Avatar asked Oct 16 '25 06:10

TheGamerLord


1 Answers

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

like image 198
JanF Avatar answered Oct 17 '25 21:10

JanF