← 返回
效率工具 中文

PC Master

Control the Windows PC from WSL2. Use when the user asks to open/close applications, manage processes, take screenshots, control windows, manage files on Win...
从 WSL2 控制 Windows 电脑。当用户请求打开/关闭应用程序、管理进程、截图、控制窗口或管理 Windows 文件时使用。
amirgu
效率工具 clawhub v1.0.0 1 版本 99786.9 Key: 无需
★ 0
Stars
📥 1,405
下载
💾 47
安装
1
版本
#latest

概述

PC Master — Windows Control from WSL2

All Windows binaries are accessible via /mnt/c/Windows/System32/. Call them directly from bash.

Prerequisites

WSL2 interop must be working. If .exe calls fail with UtilAcceptVsock errors, ask the user to run wsl --shutdown in Windows and relaunch WSL.

Core Commands

Processes

# List all processes
/mnt/c/Windows/System32/tasklist.exe

# Filter by name
/mnt/c/Windows/System32/tasklist.exe /FI "IMAGENAME eq chrome.exe"

# Kill by name
/mnt/c/Windows/System32/taskkill.exe /F /IM chrome.exe

# Kill by PID
/mnt/c/Windows/System32/taskkill.exe /F /PID 1234

Launch Applications

# Open a URL in default browser
/mnt/c/Windows/System32/cmd.exe /c "start https://google.com"

# Open an app by name
/mnt/c/Windows/System32/cmd.exe /c "start chrome"
/mnt/c/Windows/System32/cmd.exe /c "start spotify"
/mnt/c/Windows/System32/cmd.exe /c "start notepad"

# Open a file with its default app
/mnt/c/Windows/System32/cmd.exe /c "start C:\\Users\\User\\file.pdf"

# Launch full path
/mnt/c/Windows/System32/cmd.exe /c "start \"\" \"C:\\Program Files\\App\\app.exe\""

> ⚠️ cmd.exe /c start must be run from a Windows path. Use /mnt/c/Windows/System32/cmd.exe /c "cd /d C:\ && start ..." if cwd is a UNC path (WSL path).

PowerShell (advanced)

PS=/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe

# Run a command
$PS -NonInteractive -Command "Get-Process | Select-Object -First 10"

# Get window titles
$PS -NonInteractive -Command "Get-Process | Where-Object {$_.MainWindowTitle} | Select-Object Name, MainWindowTitle"

# Set volume
$PS -NonInteractive -Command "(New-Object -ComObject WScript.Shell).SendKeys([char]174)"

Screenshot

# Take a screenshot and save to Windows desktop
PS=/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe
$PS -NonInteractive -Command "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Screen]::PrimaryScreen | ForEach-Object { \$bmp = New-Object System.Drawing.Bitmap(\$_.Bounds.Width, \$_.Bounds.Height); \$g = [System.Drawing.Graphics]::FromImage(\$bmp); \$g.CopyFromScreen(\$_.Bounds.Location, [System.Drawing.Point]::Empty, \$_.Bounds.Size); \$bmp.Save('C:\\screenshot.png') }"

File System (Windows paths)

# Windows C:\ is at /mnt/c/ in WSL
ls /mnt/c/Users/
cat /mnt/c/Users/Username/Desktop/file.txt
cp /mnt/c/Users/Username/Downloads/file.zip /mnt/c/Users/Username/Desktop/

# Find Windows username
ls /mnt/c/Users/ | grep -v "Public\|Default\|All Users"

System Info

# Windows version
/mnt/c/Windows/System32/cmd.exe /c "ver"

# Disk usage
/mnt/c/Windows/System32/cmd.exe /c "wmic logicaldisk get size,freespace,caption"

# Network info
/mnt/c/Windows/System32/ipconfig.exe

Common Patterns

Close and reopen an app:

/mnt/c/Windows/System32/taskkill.exe /F /IM chrome.exe
sleep 2
/mnt/c/Windows/System32/cmd.exe /c "start chrome"

Check if app is running:

/mnt/c/Windows/System32/tasklist.exe /FI "IMAGENAME eq spotify.exe" | grep -i spotify && echo "Running" || echo "Not running"

Open a specific website:

/mnt/c/Windows/System32/cmd.exe /c "start https://www.google.com"

Notes

  • Output may contain garbled characters (Windows encoding vs UTF-8) — this is normal, content is still readable
  • Some GUI apps launched via start won't produce output — that's expected
  • For interactive PowerShell scripts, write to a temp file and read it back instead of capturing stdout directly
  • See references/windows-apps.md for common app executable names

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 07:21 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 438 📥 147,478
productivity

Nano Pdf

steipete
使用nano-pdf CLI通过自然语言指令编辑PDF
★ 275 📥 114,802
productivity

Obsidian

steipete
操作 Obsidian 仓库(纯 Markdown 笔记)并通过 obsidian-cli 自动化。
★ 432 📥 103,752