wechat-file-sender
Send files via Windows WeChat client using RPA automation. No external dependencies — pure PowerShell + Windows Automation API.
Best use case
wechat-file-sender is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Send files via Windows WeChat client using RPA automation. No external dependencies — pure PowerShell + Windows Automation API.
Teams using wechat-file-sender should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/wechat-file-sender/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How wechat-file-sender Compares
| Feature / Agent | wechat-file-sender | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Send files via Windows WeChat client using RPA automation. No external dependencies — pure PowerShell + Windows Automation API.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Top AI Agents for Productivity
See the top AI agent skills for productivity, workflow automation, operational systems, documentation, and everyday task execution.
AI Agents for Freelancers
Browse AI agent skills for freelancers handling client research, proposals, outreach, delivery systems, documentation, and repeatable admin work.
SKILL.md Source
# wechat-file-sender
Send files via Windows WeChat client using RPA automation. No external dependencies — pure PowerShell + Windows Automation API.
**Security:** filePath must be an absolute path. contactName is validated to 50 chars max, Chinese/alphanumeric/underscore/space only. No network calls, no data exfiltration.
## Setup
Requirements: Windows OS with WeChat desktop client installed.
```
clawhub install wechat-file-sender --dir <your-skills-dir>
```
## Usage
### Command line
```bash
node scripts/send-file-to-wechat.js "<filePath>" "<contactName>"
```
### OpenClaw trigger phrases
- `向wechat发送文件给[联系人]:文件路径`
- `发微信文件给[联系人]:文件路径`
## PowerShell Script Source (`scripts/send-file.ps1`)
Full source — audit it before running:
```powershell
param(
[string]$filePath,
[string]$contactName
)
Add-Type -AssemblyName UIAutomationClient
Add-Type -AssemblyName UIAutomationTypes
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName PresentationCore
# Step 0: Check file exists
if (-not (Test-Path $filePath)) {
Write-Host "[ERROR] File not found"
exit 1
}
# Step 1: Find WeChat window (class Qt51514QWindowIcon)
$root = [System.Windows.Automation.AutomationElement]::RootElement
$allWindows = $root.FindAll([System.Windows.Automation.TreeScope]::Children,
(New-Object System.Windows.Automation.PropertyCondition(
[System.Windows.Automation.AutomationElement]::ControlTypeProperty,
[System.Windows.Automation.ControlType]::Window)))
$wechatWindow = $null
foreach ($w in $allWindows) {
if ($w.Current.ClassName -match 'Qt51514QWindowIcon') {
$wechatWindow = $w
break
}
}
if (-not $wechatWindow) {
Write-Host "[ERROR] WeChat not found"
exit 1
}
# Win32 API for window focus
Add-Type @"
using System;
using System.Runtime.InteropServices;
public class WinAPI {
[DllImport("user32.dll")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll")]
public static extern bool IsIconic(IntPtr hWnd);
public const int SW_MINIMIZE = 6;
public const int SW_RESTORE = 9;
}
"@
$hwnd = [IntPtr]$wechatWindow.Current.NativeWindowHandle
if ([WinAPI]::IsIconic($hwnd)) {
[WinAPI]::ShowWindow($hwnd, [WinAPI]::SW_RESTORE)
}
[WinAPI]::SetForegroundWindow($hwnd)
Start-Sleep 1
# Step 2: Open search (Ctrl+F)
[System.Windows.Forms.SendKeys]::SendWait("^f")
Start-Sleep 1
# Step 3: Type contact name (via clipboard — SendKeys can't type Chinese)
[System.Windows.Forms.Clipboard]::Clear()
Start-Sleep 0.3
[System.Windows.Forms.Clipboard]::SetText($contactName)
Start-Sleep 0.5
[System.Windows.Forms.SendKeys]::SendWait("^v")
Start-Sleep 2
# Step 4: Select first result and enter chat
[System.Windows.Forms.SendKeys]::SendWait("{UP}")
Start-Sleep 0.5
[System.Windows.Forms.SendKeys]::SendWait("{ENTER}")
Start-Sleep 1
# Step 5: CLIPBOARD ACTIVATION TRICK
# When staying in the same window, clipboard may not activate.
# Minimize -> set clipboard -> restore = clipboard activates
[WinAPI]::ShowWindow($hwnd, [WinAPI]::SW_MINIMIZE)
Start-Sleep 0.5
$fc = New-Object System.Collections.Specialized.StringCollection
$fc.Add((Resolve-Path $filePath))
[System.Windows.Forms.Clipboard]::Clear()
Start-Sleep 0.5
[System.Windows.Forms.Clipboard]::SetFileDropList($fc)
Start-Sleep 1
[WinAPI]::ShowWindow($hwnd, [WinAPI]::SW_RESTORE)
Start-Sleep 0.5
[WinAPI]::SetForegroundWindow($hwnd)
Start-Sleep 0.5
# Step 6: Paste and send
[System.Windows.Forms.SendKeys]::SendWait("^v")
Start-Sleep 1
[System.Windows.Forms.SendKeys]::SendWait("{ENTER}")
Write-Host "[OK] File sent to: $contactName"
```
## Key Implementation Notes
- **ExecutionPolicy Bypass** is required — PowerShell blocks `.ps1` scripts by default. Bypass only affects this specific script file, not system policy.
- **No admin needed** — uses only user-level Win32 APIs (SetForegroundWindow, ShowWindow) and Windows Automation API.
- **Clipboard activation trick** — solves the Windows clipboard issue when source and target are the same window.
- **Contact name via clipboard** — SendKeys cannot type Chinese characters; workaround is to copy to clipboard and Ctrl+V.Related Skills
filesystem
Advanced filesystem operations for listing files, searching content, batch processing, and directory analysis. Supports recursive search, file type filtering, size analysis, and batch operations like copy/move/delete. Use when you need to: list directory contents, search for files by name or content, analyze directory structures, perform batch file operations, or analyze file sizes and distribution.
file-organizer-skill
Organize files in directories by grouping them into folders based on their extensions or date. Includes Dry-Run, Recursive, and Undo capabilities.
name: welight-wechat-layout-publish
description: Welight standalone skill for turning an article into WeChat Official Accounts compatible Markdown/HTML, presenting built-in theme choices, and publishing to WeChat as a draft or formal post when publishing prerequisites are already configured.
wechat-publisher
一键发布 Markdown 到微信公众号草稿箱。基于 wenyan-cli,支持多主题、代码高亮、图片自动上传。
wechat-report
Generate a structured comparison report for multiple WeChat Official Account articles under one topic. Use this when the user wants several公众号文章 collected into one local report with article metadata, engagement status, content structure tables,爆款写法标签, and a later optional Feishu sync step.
wechat-collect
Fetch a public WeChat article URL, archive the raw HTML, and convert the article into a stage-1 compatible brief in `content-production/inbox/`. Use when Codex needs to collect公众号文章素材 or start the Stage 2 collect-to-create pipeline from a public `mp.weixin.qq.com` URL.
wechat-studio
Launch a local WeChat article workbench for Markdown import, WeChat HTML preview, theme tuning, image selection, and optional draft push. Use when Codex needs a browser-based preview and manual QA layer before publishing.
wechat-formatter
Render article markdown into WeChat-style HTML as an independent executor. Use when Codex needs公众号排版预览, WeChat HTML output, or a publishable HTML artifact generated from an article markdown draft.
wechat-article-extractor
Extract metadata and content from WeChat Official Account articles. Use when user needs to parse WeChat article URLs (mp.weixin.qq.com), extract article info (title, author, content, publish time, cover image), or convert WeChat articles to structured data. Supports various article types including posts, videos, images, voice messages, and reposts.
wechat-monitor
微信公众号调研 + 监控 + 报告推送。每个产品独立目录,互不影响。
wechat-auto-publishing-complete
Use this skill to fully reproduce and operate a local end-to-end WeChat Official Account publishing workflow: prepare the environment, validate dependencies, configure non-sensitive placeholders for credentials, gather source material, draft articles, prepare cover and body images, assemble a WeChat-ready Markdown package, publish to draft, optionally submit for formal publication, poll status, archive outputs, and attach scheduling or alerting. Use whenever the user wants a complete reproducible公众号自动发文 skill with environment setup, templates, runbooks, and execution scaffolding, while keeping all secrets and personal account details outside the skill package. Key real-world findings: freepublish does not always behave like manual platform publishing for homepage visibility, production mode should often default to draft-only, image files must be validated by real format rather than extension alone, and multi-account deployments should use isolated directories.
site-profile
Short alias for external-site-profile-learning. Use this when investigating, adding, validating, or debugging external website profiles for the 99idea Playwright browser demo.