360 Secure SkillHub
360 安全技能中心

Windows UI Automation

该 Skill 提供 Windows 桌面 GUI 自动化能力:通过 mouse_control.ps1.txt 与 keyboard_control.ps1.txt 执行光标移动、点击、输入文本和发送特殊键,并可用 WScript.Shell 按窗口标题激活窗口。文档给出 PowerShell 调用示例以及延迟、坐标、截图验证等注意事项;未提供窗口管理与截图的实际脚本实现。

分类:自动化
wwb-daniel
wwb-daniel
热度 59.53
最近更新 2026-05-17 11:50:23

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add wwb-daniel/windows-ui-automation
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
windows-ui-automation
description
Automate Windows GUI interactions (mouse, keyboard, windows) using PowerShell. Use when the user needs to simulate user input on the desktop, such as moving the cursor, clicking buttons, typing text in non-web apps, or managing window states.

Windows UI Automation

Control the Windows desktop environment programmatically.

Core Capabilities

  • Mouse: Move, click (left/right/double), drag.
  • Keyboard: Send text, press special keys (Enter, Tab, Alt, etc.).
  • Windows: Find, focus, minimize/maximize, and screenshot windows.

Usage Guide

Mouse Control

Use the provided PowerShell script mouse_control.ps1.txt:

# Move to X, Y
powershell -File skills/windows-ui-automation/mouse_control.ps1.txt -Action move -X 500 -Y 500

# Click at current position
powershell -File skills/windows-ui-automation/mouse_control.ps1.txt -Action click

# Right click
powershell -File skills/windows-ui-automation/mouse_control.ps1.txt -Action rightclick

Keyboard Control

Use keyboard_control.ps1.txt:

# Type text
powershell -File skills/windows-ui-automation/keyboard_control.ps1.txt -Text "Hello World"

# Press Enter
powershell -File skills/windows-ui-automation/keyboard_control.ps1.txt -Key "{ENTER}"

Window Management

To focus a window by title:

$wshell = New-Object -ComObject WScript.Shell; $wshell.AppActivate("Notepad")

Best Practices

  1. Safety: Always move the mouse slowly or include delays between actions.
  2. Verification: Take a screenshot before and after complex UI actions to verify state.
  3. Coordinates: Remember that coordinates (0,0) are at the top-left of the primary monitor.