---
name: "win11-program-launcher"
description: "教用户在 Windows 11 上通过批处理脚本 (.bat) 启动或批量启动指定程序，以及关闭程序。当用户需要启动程序、批量启动多个程序、制作一键启停脚本时触发此技能。"
title: win11-program-launcher
canonical_url: https://skilld.dev/gh/steelan9199/wechat-publisher/win11-program-launcher
last_updated: 2026-10-07T07:20:50.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install steelan9199/wechat-publisher/win11-program-launcher`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/win11-program-launcher`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/steelan9199/wechat-publisher/win11-program-launcher) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/win11-program-launcher`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/win11-program-launcher --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/win11-program-launcher --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Win11 程序启动器

此技能帮助 Windows 11 用户通过**批处理脚本 (.bat)** 一键启动或批量启动程序，以及强制关闭程序。

---

## 适用场景

- 需要在 Win11 上写一个批处理脚本来启动一个或多个程序
- 需要一键同时启动多个程序（如录屏工具、辅助工具等）
- 需要一键强制关闭指定的程序
- 制作"演示/录屏/开发环境"的一键启停脚本

---

## 核心语法

### 1. 启动程序

```batch
start /d "程序的所在目录完整路径" 程序名.exe
```

- `start` — 启动一个新窗口运行程序
- `/d` — 指定程序的**起始工作目录**（程序运行时的当前目录）
- 后面跟要执行的 `.exe` 文件名

**注意：** 如果程序路径不在系统 PATH 中，务必使用 `/d` 指定目录，否则可能找不到依赖文件。

### 2. 强制关闭程序

```batch
taskkill /f /im 程序名.exe
```

- `taskkill` — 结束进程
- `/f` — 强制终止（不等待程序响应）
- `/im` — 按镜像名（即进程名）匹配

---

## 完整示例：一键启停多个程序

以下是一个真实的"录制演示视频辅助工具"脚本，先启动三个工具，再用下半部分一键全部关闭：

```batch
@echo off
chcp 65001 >nul

:: ====== 启动程序 ======
start /d "D:\software\PointerFocus\pointerfocus2.4\PointerFocus" PointerFocus.exe
start /d "C:\Users\Administrator\AppData\Local\carnac" Carnac.exe
start /d "D:\software\obs\obs-studio\bin\64bit" obs64.exe

echo 所有程序已启动！
pause

:: ====== 关闭程序 ======
taskkill /f /im obs64.exe
taskkill /f /im PointerFocus.exe
taskkill /f /im Carnac.exe

echo 所有程序已关闭！
pause
```

> `@echo off` 关闭命令回显，`chcp 65001 >nul` 设置控制台编码为 UTF-8 防止中文乱码，`pause` 让窗口停留等待按键。

---

## 生成脚本的原则

为 Win11 用户生成脚本时，遵循以下原则：

1. **始终以 `@echo off` 开头**，保持输出干净
2. **添加 `chcp 65001 >nul`** 防止中文乱码
3. **路径用双引号包裹**，防止空格路径出错
4. **启动和关闭分成两个区域**，用 `::` 注释分隔
5. **后缀使用 `.bat`**（兼容性最好，Win11 直接双击运行）
6. **如果不确定某个程序所在目录**，可以建议用户用 Win11 任务管理器的"打开文件所在位置"来定位
7. **关闭脚本永远放在同一个文件的后面**，用 `pause` 隔开，方便用户先启动、用完后一键关闭

---

## 与用户交互

当用户请求"启动程序"或"批量启动"时：
1. 先问清要启动哪些程序、各自的安装路径
2. 如果用户只提供程序名不知道路径，可以建议几种定位路径的方法：
   - 开始菜单 → 右键程序 → 打开文件位置
   - 任务管理器 → 找到进程 → 右键 → 打开文件所在位置
   - `where 程序名` 命令（仅对 PATH 中的程序有效）
3. 生成 `.bat` 脚本给用户，放在一个方便的位置（如桌面或项目目录）
4. 提醒用户：双击 `.bat` 即可运行，右键可"以管理员身份运行"（某些程序需要管理员权限）
