在 DSH 内把 Windows .bat/.cmd 启动器编译成真正的 .exe:用内置位图字体生成图标,生成调用同目录批处理的 C# 薄壳,经 csc.exe(或 dotnet build)编译,并可选写入开始菜单/桌面快捷方式。
安装
# npm 包(预构建)
dsh plugin --profile web add dsh-bat2exe
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:nirvanaslash/dsh-bat2exe
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
Turn a Windows .bat / .cmd launcher into a real .exe — from inside DeepSeek Harness.
The EXE is a thin shell: it locates the batch file next to itself and hands the
whole job to cmd.exe. The launcher logic stays editable text, no tool path is baked
into the binary, and upgrading whatever the batch file calls needs no recompilation.
Install
dsh plugin --profile web add dsh-bat2exe
Restart DSH, then ask the agent to build a launcher — or call the tool directly.
Tools
bat2exe_build
| Parameter | Meaning |
|---|---|
bat |
required — path to the .bat/.cmd file (absolute, or relative to the working directory) |
name |
output executable name; defaults to the batch name with .exe |
iconText |
up to four characters drawn on a generated icon |
iconTextColour |
icon text colour as #rrggbb |
icon |
use an existing .ico instead of rendering one |
startMenuShortcut |
also write a Start Menu shortcut |
desktopShortcut |
also write a Desktop shortcut |
The build runs four steps, all local and offline:
- Icon — renders a rounded-square plate with a diagonal gradient and the given text, using a built-in 5×7 bitmap font, then packs it as a 256×256 ICO. No image library, no external tool.
- C# shell — emits a wrapper whose only job is to run the batch file from its own directory, forwarding all arguments and preserving the exit code.
- Compile —
csc.exefrom the .NET Framework (falling back todotnet buildwhen only the .NET SDK is present), with the icon embedded as a resource. - Shortcuts — optional
.lnkfiles, written throughWScript.Shell.
bat2exe_probe
Reports the local toolchain — C# compiler path, .NET SDK presence, PowerShell, and the resolved defaults — so a failure can be diagnosed before a build is attempted.
Settings
bat2exe registers a settings namespace, so defaults are editable in
Settings → Plugins rather than by hand-editing a profile patch:
| Key | Default | Meaning |
|---|---|---|
iconText |
BAT |
text drawn on a generated icon |
iconFrom / iconTo |
#12204a / #4a6cf7 |
gradient start / end |
workDir |
.bat2exe |
where *.cs, *.ico and other by-products go |
startMenuShortcut |
false |
default for the Start Menu shortcut |
desktopShortcut |
false |
default for the Desktop shortcut |
Per-call tool arguments always win over these defaults.
Requirements
- Windows. The pipeline compiles a Windows PE and writes
.lnkfiles. - A C# compiler: .NET Framework 4.x (
csc.exe, present on stock Windows) or the .NET SDK. - PowerShell for shortcut creation only (
pwshpreferred, Windows PowerShell accepted).
bat2exe_probe reports exactly which of these were found.
What gets written
Everything lives next to the batch file, so a launcher folder is self-contained:
DSH-Web.bat <- your launcher (unchanged)
DSH-Web.exe <- the compiled shell
.bat2exe/
DSH-Web.ico <- generated (or your supplied) icon
DSH-Web.cs <- the emitted C# source, kept for inspection
License
MIT
链接
同类插件
yjh051108/dsh-routing-suite★ 6991
一个仓库三件套:DSH 插件包的运行时注入器(注入、热重载、卸载、开发侧挂区一键转正、路由自愈,外带设置页插件管理:列出、卸载、拖入文件夹内化)、任务感知的思维模式路由 agent 预设(router-standard / router-spec / router-react)、以及分级两级任务协议(commit_star / lock_stage / revise_do / edit_plan / mark_task / redteam_verdict 六个工具,任务状态落盘)。注入器实现直接在库内,安装的是它自己的行为而不是一份依赖清单。
strukto-ai/mirage#dsh★ 3715
把文件系统与 bash 提供者换成 mirage 虚拟工作区:文件工具与 shell 命令作用于挂载的资源(RAM、S3、Redis、Slack、Gmail、Notion、Postgres)而非宿主磁盘,支持按挂载点设置读/写/执行模式、按命令选择沙箱(进程内 monty、pyodide、quickjs;远程 docker、e2b、daytona),并可在虚拟终端中安装 CLI(git、gh、slack、linear、ntn、gws,或自行注册的程序树)作为命令头词。
first-fluke/oh-my-agent#dsh★ 1352
在工具执行前后以及尝试结束当前轮次时运行项目 OMA 检查。随插件安装 OMA CLI 依赖,并在首次使用时初始化未配置的项目。需要 Node.js 22+;首次初始化需要网络连接和项目目录写入权限。
hust-open-atom-club/oh-dsh★ 323
社区发行版:TUI、桌面端与 Web UI 统一体验,分层安装、一步到位。
MichengAI/dsh-skills-manager★ 294
在设置里管理本地 DSH 技能,并只读查看公共 Agent 技能。
Fishquito7/dsh-skill-mcp-panel★ 223
在 DSH Web 设置中管理技能与 MCP 服务器:技能卡片热启停、工作区作用域、分组、批量迁移与拖拽导入,以及 stdio/HTTP MCP 增删改查、连接测试、密钥脱敏,并附带统一 dsh-panel 命令行。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。