移动鼠标光标 N 个像素的 Windows 命令脚本



我正在尝试找出如何将鼠标光标N像素移动到某个方向....通过命令脚本,因为我无法在计算机上安装任何东西。

基本上试图让屏幕永远保持活动状态,直到我杀死脚本。

(是的,我一直在上下搜索命令脚本的方法......但找不到任何东西。我希望这是可能的。

使用批处理文件操作鼠标的最直接方法是使用

rundll32 user32.dll,SetCursorPos

但这不是很有用 - 只是将鼠标设置为 0,0 位置。

检查鼠标.bat - 它是一个自编译的 C#/批处理文件,不需要外部工具,源代码是可见和可编辑的。

例子:

//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

搜索 NirCmd,并将其安装在 C:\windows 中,然后执行以下操作:

nircmd setcursor 100 50
nircmd movecursor 10 10

或其他用于单击等的命令。

(答案较晚,但对其他人仍然有用)如果您只是想让计算机不入睡,"咖啡因"软件可以很好地做到这一点。

尝试将睡眠模式设置为"无",但如果您想在不触摸鼠标的情况下移动鼠标,请下载 memz clean,让"随机光标移动"变为蓝色。 现在享受。(如果不起作用,则必须禁用有效负载。 尝试执行 Shift+ESC 以启用/禁用有效负载。 尝试执行 Ctrl+Shift+s 以跳过一些时间,因为几分钟后鼠标会抖动得更好。

最新更新