Automate mouse click in windows with script/batch file

前端 未结 3 695
执笔经年
执笔经年 2020-12-31 05:27

Firstly I\'d like to point out that this is a rather strange question and also that I don\'t even know if stackoverflow is right for this...

Anyways, is there a way

3条回答
  •  情歌与酒
    2020-12-31 06:15

    nircmd is capable to do some basic mouse stuff. Check mouse.bat - self-compiled C# class (c# compiler is installed by default from everything from vista and above) capable to command the mouse from command line (also pretty basic but can do a little bit more than nircmd). with mouse.bat -help you can see the help and some example actions.

    here's example usage:

    Examples:

    ::clicks at the current position
    call mouse click
    
    ::double clicks at the current position
    call mouse doubleClick
    
    ::right clicks at the current position
    call mouse rightClick
    
    ::returns the position of the cursor
    call mouse position
    
    ::scrolls up the mouse wheel with 1500 units
    call mouse scrollUp 150
    
    ::scrolls down with 100 postitions
    call mouse scrollDown 100
    
    ::relatively(from the current position) moves the mouse with 100 horizontal and 100 vertial postitions
    call mouse moveBy 100x100
    
    ::absolute positioning
    call mouse moveTo 100x100
    
    ::relative drag (lefclick and move)
    call mouse dragBy 300x200
    
    ::absolute drag
    call mouse dragTo 500x500
    

提交回复
热议问题