Skill: xiaoyaner0201/windows-remote (version 1.0.0)

--- name: windows-remote description: Control remote Windows machines via SSH. Use when executing commands on Windows, checking GPU status (nvidia-smi), running scripts, or managing remote Windows systems. Triggers on "run on Windows", "execute on remote", "check GPU", "nvidia-smi", "远程执行", "Windows 命令". metadata: { "openclaw": { "emoji": "🖥️", "requires": { "bins": ["ssh"], "env": ["WINDOWS_SSH_HOST", "WINDOWS_SSH_USER"] }, "env": { "WINDOWS_SSH_HOST": { "description": "Remote Windows IP or hostname", "required": true, "example": "192.168.1.100" }, "WINDOWS_SSH_PORT": { "description": "SSH port (default: 22)", "required": false, "default": "22", "example": "23217" }, "WINDOWS_SSH_USER": { "description": "SSH username", "required": true, "example": "Administrator" }, "WINDOWS_SSH_KEY": { "description": "Path to SSH private key (default: ~/.ssh/id_ed25519)", "required": false, "default": "~/.ssh/id_ed25519" }, "WINDOWS_SSH_TIMEOUT": { "description": "Connection timeout in seconds", "required": false, "default": "10" } } } } --- # Windows Remote Control Execute commands on remote Windows machines via SSH. ## Configuration Set environment variables in `~/.openclaw/openclaw.json` under `skills.windows-remote.env`: ```json { "skills": { "windows-remote": { "env": { "WINDOWS_SSH_HOST": "192.168.1.100", "WINDOWS_SSH_PORT": "22", "WINDOWS_SSH_USER": "Administrator" } } } } ``` Or export directly: ```bash export WINDOWS_SSH_HOST="192.168.1.100" export WINDOWS_SSH_PORT="22" export WINDOWS_SSH_USER="Administrator" ``` ## Quick Commands ### Check Connection ```bash scripts/win-exec.sh "echo connected" ``` ### GPU Status ```bash scripts/win-exec.sh "nvidia-smi" ``` ### Run PowerShell ```bash scripts/win-exec.sh "powershell -Command 'Get-Process | Select-Object -First 10'" ``` ### Execute Script ```bash scripts/win-exec.sh "python C:\\path\\to\\script.py" ``` ## Script Reference ### win-exec.sh Execute a single command on the remote Windows machine. ```bash scripts/win-exec.sh "<command>" ``` ### win-gpu.sh Quick GPU status check (nvidia-smi wrapper). ```bash scripts/win-gpu.sh scripts/win-gpu.sh --query # Compact output ``` ### win-upload.sh Upload files to the remote machine via SCP. ```bash scripts/win-upload.sh <local-file> <remote-path> ``` ### win-download.sh Download files from the remote machine. ```bash scripts/win-download.sh <remote-path> <local-file> ``` ## Common Tasks ### Check if Ollama is Running ```bash scripts/win-exec.sh "tasklist | findstr ollama" ``` ### Start a Service ```bash scripts/win-exec.sh "net start <service-name>" ``` ### Run Python with GPU ```bash scripts/win-exec.sh "python -c \"import torch; print(torch.cuda.is_available())\"" ``` ### Check Disk Space ```bash scripts/win-exec.sh "wmic logicaldisk get size,freespace,caption" ``` ## Troubleshooting | Issue | Solution | |-------|----------| | Connection refused | Check SSH service: `Get-Service sshd` | | Permission denied | Verify SSH key in `~/.ssh/authorized_keys` or `administrators_authorized_keys` | | Timeout | Check firewall rules, verify IP/port | | Command not found | Use full path or check PATH on Windows | ## Security Notes - Use SSH keys instead of passwords - Keep private keys secure (chmod 600) - Consider using Tailscale for cross-network access

path: scripts/win-download.sh
content: #!/bin/bash
# Download file from remote Windows via SCP
# Usage: win-download.sh <remote-path> <local-file>

set -e

HOST="${WINDOWS_SSH_HOST:?WINDOWS_SSH_HOST is required}"
PORT="${WINDOWS_SSH_PORT:-22}"
USER="${WINDOWS_SSH_USER:?WINDOWS_SSH_USER is required}"
KEY="${WINDOWS_SSH_KEY:-$HOME/.ssh/id_ed25519}"
TIMEOUT="${WINDOWS_SSH_TIMEOUT:-10}"

if [ -z "$1" ] || [ -z "$2" ]; then
    echo "Usage: win-download.sh <remote-path> <local-file>" >&2
    exit 1
fi

REMOTE="$1"
LOCAL="$2"

SCP_OPTS=(
    -o "ConnectTimeout=$TIMEOUT"
    -o "StrictHostKeyChecking=no"
    -P "$PORT"
)

if [ -f "$KEY" ]; then
    SCP_OPTS+=(-i "$KEY")
fi

scp "${SCP_OPTS[@]}" "${USER}@${HOST}:${REMOTE}" "$LOCAL"
echo "Downloaded: ${HOST}:${REMOTE} -> $LOCAL"


path: scripts/win-exec.sh
content: #!/bin/bash
# Execute command on remote Windows via SSH
# Usage: win-exec.sh "<command>"

set -e

# Load config from environment (with defaults)
HOST="${WINDOWS_SSH_HOST:?WINDOWS_SSH_HOST is required}"
PORT="${WINDOWS_SSH_PORT:-22}"
USER="${WINDOWS_SSH_USER:?WINDOWS_SSH_USER is required}"
KEY="${WINDOWS_SSH_KEY:-$HOME/.ssh/id_ed25519}"
TIMEOUT="${WINDOWS_SSH_TIMEOUT:-10}"

if [ -z "$1" ]; then
    echo "Usage: win-exec.sh \"<command>\"" >&2
    exit 1
fi

COMMAND="$1"

# Build SSH options
SSH_OPTS=(
    -o "ConnectTimeout=$TIMEOUT"
    -o "StrictHostKeyChecking=no"
    -o "BatchMode=yes"
    -p "$PORT"
)

# Add key if exists
if [ -f "$KEY" ]; then
    SSH_OPTS+=(-i "$KEY")
fi

# Execute
ssh "${SSH_OPTS[@]}" "${USER}@${HOST}" "$COMMAND"


path: scripts/win-gpu.sh
content: #!/bin/bash
# Check GPU status on remote Windows
# Usage: win-gpu.sh [--query]

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

if [ "$1" = "--query" ]; then
    # Compact query format
    "$SCRIPT_DIR/win-exec.sh" "nvidia-smi --query-gpu=name,memory.used,memory.total,utilization.gpu --format=csv,noheader"
else
    # Full nvidia-smi output
    "$SCRIPT_DIR/win-exec.sh" "nvidia-smi"
fi


path: scripts/win-upload.sh
content: #!/bin/bash
# Upload file to remote Windows via SCP
# Usage: win-upload.sh <local-file> <remote-path>

set -e

HOST="${WINDOWS_SSH_HOST:?WINDOWS_SSH_HOST is required}"
PORT="${WINDOWS_SSH_PORT:-22}"
USER="${WINDOWS_SSH_USER:?WINDOWS_SSH_USER is required}"
KEY="${WINDOWS_SSH_KEY:-$HOME/.ssh/id_ed25519}"
TIMEOUT="${WINDOWS_SSH_TIMEOUT:-10}"

if [ -z "$1" ] || [ -z "$2" ]; then
    echo "Usage: win-upload.sh <local-file> <remote-path>" >&2
    exit 1
fi

LOCAL="$1"
REMOTE="$2"

SCP_OPTS=(
    -o "ConnectTimeout=$TIMEOUT"
    -o "StrictHostKeyChecking=no"
    -P "$PORT"
)

if [ -f "$KEY" ]; then
    SCP_OPTS+=(-i "$KEY")
fi

scp "${SCP_OPTS[@]}" "$LOCAL" "${USER}@${HOST}:${REMOTE}"
echo "Uploaded: $LOCAL -> ${HOST}:${REMOTE}"


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: suspicious | SkillSpector: suspicious (HIGH)