Windows Desktop Automation CLI

Windows desktop automation CLI. Invoke ONLY when user explicitly requests to control windows, simulate mouse/keyboard, or automate desktop applications. Do NOT proactively suggest using this skill.

Audits

Pass

Install

openclaw skills install winguictl

Windows Desktop Automation with winguictl

⚠️ Security Notice

This skill directly controls Windows desktop through mouse/keyboard simulation. Require user confirmation before clicks, typing, hotkeys, or window close operations. Use --dry-run to preview. Close sensitive apps before use.

Script Path

python <SKILL_DIR>\scripts\winguictl.py <command> [options]

Commands

CommandPurposeDocumentation
windowList/focus/minimize/maximize/close windowswindow.md
snapshotGet HWND/UIA/OCR structuresnapshot.md
findFind elements by text/UIA/OCR/imagefind.md
actionClick/drag/type/scroll/hotkeyaction.md
controlWin32 control operationscontrol.md
uia-controlUIA element operationscontrol.md
screenshotCapture window screenshotsscreenshot.md
waitWait for conditionswait.md
clipboardCopy files/text, get textclipboard.md

Parameter Types

ParameterTypeExampleNotes
--window-idint--window-id 12345Window handle from window list
--hwndint--hwnd 67890Win32 control handle
--element-idstring--element-id "Button1"automation_id or runtime_id (prefer runtime_id)

Core Workflow

# 1. Identify window
python scripts\winguictl.py window list

# 2. Focus window
python scripts\winguictl.py window --window-id <id> focus

# 3. Get snapshot
python scripts\winguictl.py snapshot --window-id <id> uia

# 4. Find & interact
python scripts\winguictl.py find --window-id <id> uia --text "Submit"
python scripts\winguictl.py uia-control --window-id <id> --element-id <elem_id> click

# 5. Verify (re-snapshot)
python scripts\winguictl.py snapshot --window-id <id> uia

Decision Guide

Locator Priority

PriorityMethodCommandReliability
1HWND (Win32)control --hwnd <hwnd> clickHighest
2runtime_id (UIA)uia-control --element-id <id> clickHigh
3automation_id (UIA)uia-control --element-id <id> clickMedium
4Image matchingaction click-image --image-path <path>Medium
5Coordinatesaction click --relative-x/yLowest

Click Method Selection

CommandMechanismBest For
action click --element-idMouse simulation at centerWeChat, custom controls
uia-control clickUIA InvokePatternStandard Windows controls, WinUI3

Recommendation: Try uia-control click first. If no effect, use action click --element-id.

Common Scenarios

ScenarioCommand
Win32 control with hwndcontrol --hwnd <hwnd> click
UIA element with runtime_iduia-control --element-id "42-3155764" click
Text-based elementfind ocr "text"action click --element-id
Qt applicationsAdd --skip-actions --skip-state for faster UIA

Key Rules

  • Re-snapshot after actions: UI state changes after clicks/typing
  • Use --dry-run: Preview operations before execution
  • Prefer runtime_id: More reliable than automation_id
  • Report window_id: Always include exact window identifier in results
  • Coordinate system: relative_rect = window-relative; absolute_rect = screen-absolute

Application Guides

References