{"id":22883027,"url":"https://github.com/zuoqiu-yingyi/url-run-command","last_synced_at":"2025-07-30T16:04:38.992Z","repository":{"id":44403379,"uuid":"432507004","full_name":"Zuoqiu-Yingyi/url-run-command","owner":"Zuoqiu-Yingyi","description":"使用 URL 协议运行命令(Run the command using URL protocol)","archived":false,"fork":false,"pushed_at":"2022-07-07T16:10:30.000Z","size":97,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-07T05:47:53.656Z","etag":null,"topics":["cmd","powershell","scheme","url","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zuoqiu-Yingyi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-27T16:11:08.000Z","updated_at":"2024-09-20T08:55:00.000Z","dependencies_parsed_at":"2022-07-15T06:00:30.242Z","dependency_job_id":null,"html_url":"https://github.com/Zuoqiu-Yingyi/url-run-command","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Zuoqiu-Yingyi/url-run-command","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zuoqiu-Yingyi%2Furl-run-command","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zuoqiu-Yingyi%2Furl-run-command/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zuoqiu-Yingyi%2Furl-run-command/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zuoqiu-Yingyi%2Furl-run-command/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zuoqiu-Yingyi","download_url":"https://codeload.github.com/Zuoqiu-Yingyi/url-run-command/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zuoqiu-Yingyi%2Furl-run-command/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267895392,"owners_count":24162197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmd","powershell","scheme","url","windows"],"created_at":"2024-12-13T18:31:49.542Z","updated_at":"2025-07-30T16:04:38.950Z","avatar_url":"https://github.com/Zuoqiu-Yingyi.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# url-run-command\n\n\u003ccenter\u003e\n\n[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/Zuoqiu-Yingyi/url-run-command?include_prereleases\u0026style=flat-square)](https://github.com/Zuoqiu-Yingyi/url-run-command/releases/latest)\n[![GitHub Release Date](https://img.shields.io/github/release-date/Zuoqiu-Yingyi/url-run-command?style=flat-square)](https://github.com/Zuoqiu-Yingyi/url-run-command/releases/latest)\n[![GitHub License](https://img.shields.io/github/license/Zuoqiu-Yingyi/url-run-command?style=flat-square)](https://github.com/Zuoqiu-Yingyi/url-run-command/blob/main/LICENSE)\n[![GitHub last commit](https://img.shields.io/github/last-commit/Zuoqiu-Yingyi/url-run-command?style=flat-square)](https://github.com/Zuoqiu-Yingyi/url-run-command/commits/main)\n![GitHub repo size](https://img.shields.io/github/repo-size/Zuoqiu-Yingyi/url-run-command?style=flat-square)\n![hits](https://hits.b3log.org/Zuoqiu-Yingyi/url-run-command.svg)\n[![GitHub all releases](https://img.shields.io/github/downloads/Zuoqiu-Yingyi/url-run-command/total?style=flat-square)](https://github.com/Zuoqiu-Yingyi/url-run-command/releases)\n\n\u003c/center\u003e\n\n使用 URL 协议运行命令(Run the command using URL protocol)\n\n---\n\n## 原理 | PRINCIPLE\n\n- 将自定义 URL 协议注册为 Windows 系统协议, 并调用一个具有如下功能的程序  \n  Register the custom URL protocol as a Windows system protocol and call a program that has the following features.\n  1. 对 URL 载荷进行 URL 解码, 获得指令  \n     Decode the URL payload to get commands.\n  2. 调用系统命令行解析器 `CMD` 或 `PowerShell` 运行指令  \n     Call the system command line parser `CMD` or `PowerShell` to run the commands.\n\n**注意**: 为了避免可能出现的 [远程命令/代码执行(Remote Command/Code Execution, RCE)](https://en.wikipedia.org/w/index.php?title=Remote_code_execution\u0026redirect=no) 攻击, 请尽量使用足够长的随机字符串作为自定义协议名称  \n**Note**: To avoid possible [RCE(Remote Command/Code Execution)](https://en.wikipedia.org/w/index.php?title=Remote_code_execution\u0026redirect=no) attacks, try to use random strings long enough as custom URL scheme name.\n\n## 开始 | START\n\n### 快速开始 | QUICK START\n\n1. 从 [Releases](https://github.com/Zuoqiu-Yingyi/url-run-command/releases) 中下载发行包并解压到自定义安装目录  \n   Download the release package from [Releases](https://github.com/Zuoqiu-Yingyi/url-run-command/releases) and unzip it to a custom installation directory.\n2. 运行安装目录中的 `install.bat` 批处理文件  \n   Run the `install.bat` batch file in your installation directory.\n3. 安装目录中将生成 `insert.reg` 与 `delete.reg` 两个注册表文件  \n   `insert.reg` and `delete.reg` registry files are generated in the installation directory.\n   - `insert.reg`: 安装时将要写入注册表的注册表项  \n     `insert.reg`: The registry key that will be written to the registry at installation time.\n   - `delete.reg`: 卸载时将要从注册表中删除的注册表项  \n     `delete.reg`: The registry key that will be removed from the registry when uninstalled.\n4. 允许对注册表的更改  \n   Allow to change the registry.\n5. 安装完成  \n   The installation is complete.\n6. 在 *Windows 资源管理器* 的地址栏中输入 `runcmd://systeminfo; pause;` 或 `runcmd:systeminfo; pause;` 并回车, 检查 URL 协议 `runcmd` 能否运行命令 `systeminfo; pause;` (查看系统信息后暂停)  \n   Enter `runcmd://systeminfo; pause;` or `runcmd:systeminfo; pause;` in the address bar of Windows Explorer and enter to check if the URL scheme `runcmd` can run command `systeminfo; pause;` (pause after viewing system information).\n7. 点击下方链接, 检查浏览器链接能否使用 `runcmd` 协议运行命令 `systeminfo; pause;`  \n   Click on links below to check if the browser link can run command `systeminfo; pause;`   using the `runcmd` protocol.\n   - [runcmd://systeminfo; pause;](https://diamondyuan.github.io/302/?location=runcmd%3A%2F%2Fsysteminfo%3B+pause%3B)\n   - [runcmd:systeminfo; pause;](https://diamondyuan.github.io/302/?location=runcmd%3Asysteminfo%3B+pause%3B)\n\n## 预览 | PREVIEW\n\n![PING](./images/preview.png)\n\n### 高级选项 | ADVANCED OPTIONS\n\n在安装目录中使用如下命令查看命令行参数  \nUse the following command in the installation directory to view command line parameters.\n\n```powershell\nPS \u003e .\\url-run.exe help\nActive code page: 65001\nSYNOPSIS\n        url-run.exe \u003curl\u003e (-c|-p) [--debug] [--parser \u003cpath\u003e]\n        url-run.exe init [-n \u003cscheme\u003e] (-c|-p) [--debug] [--parser \u003cpath\u003e]\n        url-run.exe help\n\nOPTIONS\n        \u003curl\u003e       统一资源定位符 | Uniform Resource Locator, URL\n        -c, --cmd   使用 CMD 解析器 | use CMD parser\n        -p, --powershell, --pwsh\n                    使用 PowerShell 解析器 | use PowerShell parser\n\n        --debug     输出调试信息 | output debug information\n        --parser    自定义命令解析器 | custom command parser\n        \u003cpath\u003e      自定义命令解析器路径 | path of custom command parser\n        init        初始化注册表文件 | initialize the registry file\n        -n, --name  自定义 URL 协议名称 | custom URL scheme name\n        \u003cscheme\u003e    协议自定义名称 | name of custom scheme\n        -c, --cmd   使用 CMD 解析器 | use CMD parser\n        -p, --powershell, --pwsh\n                    使用 PowerShell 解析器 | use PowerShell parser\n\n        --debug     输出调试信息 | output debug information\n        --parser    自定义命令解析器 | custom command parser\n        \u003cpath\u003e      自定义命令解析器路径 | path of custom command parser\n        help        查看参数指南 | view the parameter guide\n```\n\n### 开发者选项 | DEVELOPER OPTIONS\n\n```powershell\ngit clone https://github.com/Zuoqiu-Yingyi/url-run-command.git\n\ncd url-run-command\n\ng++ \\\n   src\\main.cpp \\\n   -o dist\\url-run \\\n   -g \\\n   -static\n\ncd dist\n\n.\\url-run.exe init \\\n   --name \"\u003c自定义 URL 协议名 | name for custom URL scheme\u003e\" \\\n   --powershell \\\n   --parser \"\u003c自定义命令解析器路径 | path for custom command parser\u003e\"\n\nstart .\\insert.reg\n```\n\n## 卸载 | UNINSTALL\n\n1. 运行安装目录中的 `uninstall.bat` 批处理文件  \n   Run the `uninstall.bat` batch file in your installation directory.\n2. 允许对注册表的更改  \n   Allow to change the registry.\n3. 卸载完成  \n   The uninstall is complete.\n\n## 依赖 | DEPENDENCE\n\n### 源码 | SOURCE\n\n- [muellan/clipp: easy to use, powerful \u0026amp; expressive command line argument parsing for modern C++ / single header / usage \u0026amp; doc generation](https://github.com/muellan/clipp#overview)*[MIT License](https://github.com/muellan/clipp/blob/master/LICENSE)*\n\n## 更改日志 | CHANGE LOG\n\n[CHANGE LOG](./CHANGELOG.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuoqiu-yingyi%2Furl-run-command","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzuoqiu-yingyi%2Furl-run-command","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuoqiu-yingyi%2Furl-run-command/lists"}