WindowsShell命令完全指南.org

Windows Shell 命令完全指南

什么是 Shell 命令

Windows 的 shell: 命令是一种特殊的快捷方式,用于直接访问系统文件夹。

使用方法

按下 <kbd>Win</br> + </kbd>R<kbd> 打开“运行”对话框,输入 shell:programs 后回车。

核心作用

快速访问 Windows 中的特定系统文件夹。

常用 Shell 命令列表

下表列出最常用的 shell: 命令及其作用。

命令 作用 范围
shell:Desktop 桌面 当前用户
shell:Downloads 下载文件夹 当前用户
shell:Personal 文档文件夹 当前用户
shell:My Music 我的音乐 当前用户
shell:My Pictures 我的图片 当前用户
shell:My Video 我的视频 当前用户
shell:Favorites 收藏夹 当前用户
shell:Recent 最近使用的项目 当前用户
shell:Startup 启动文件夹(开机自启) 当前用户
shell:Programs 开始菜单程序文件夹 当前用户
shell:SendTo 发送到菜单 当前用户
shell:AppData AppData/Roaming 当前用户
shell:Local AppData AppData/Local 当前用户
shell:Common Desktop 公用桌面 所有用户
shell:Common Programs 公用开始菜单程序文件夹 所有用户
shell:Common Startup 公用启动文件夹 所有用户
shell:Windows Windows 安装目录 系统
shell:System System32 文件夹 系统
shell:RecycleBinFolder 回收站 系统
shell:Fonts 字体文件夹 系统
shell:ControlPanelFolder 控制面板 系统
shell:PrintersFolder 打印机和设备 系统

实用示例:快速打开公用程序文件夹

场景

你想打开以下路径:

1
C:\ProgramData\Microsoft\Windows\Start Menu\Programs

解决方案

执行命令:

1
shell:common programs

shell:programs 的区别

命令 路径 作用范围 权限要求
shell:programs C:\Users\[用户名]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs 仅当前用户 普通用户
shell:common programs C:\ProgramData\Microsoft\Windows\Start Menu\Programs 所有用户 管理员权限

如何获取所有 Shell 命令

Windows 官方没有提供完整的 shell: 命令列表文档。以下是几种获取完整列表的方法。

方法一:使用 HTML 脚本自动提取

复制以下代码,保存为 shell_commands.html~,用浏览器打开即可获得当前系统支持的所有 ~shell: 命令列表(带可点击链接)。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html>
<head>
    <title>Windows Shell 命令列表</title>
    <meta charset="UTF-8">
</head>
<body>
    <h2>Windows Shell 命令列表 (点击链接即可打开)</h2>
    <ul id="cmdList"></ul>
    <script>
        (function() {
            const list = document.getElementById('cmdList');
            let foundCount = 0;

            const knownShells = [
                "AddNewProgramsFolder", "Administrative Tools", "AppData", "AppsFolder", "Cache",
                "CD Burning", "ChangeRemoveProgramsFolder", "Common Administrative Tools", "Common AppData",
                "Common Desktop", "Common Documents", "Common Programs", "Common Start Menu", "Common Startup",
                "CommonMusic", "CommonPictures", "CommonVideo", "ConflictFolder", "ConnectionsFolder", "Contacts",
                "ControlPanelFolder", "Cookies", "CredentialManager", "CryptoKeys", "CSCFolder", "Desktop",
                "Downloads", "DpapiKeys", "Favorites", "Fonts", "Games", "GameTasks", "Gadgets", "History",
                "InternetFolder", "Links", "Local AppData", "LocalAppDataLow", "LocalizedResourcesDir",
                "MAPIFolder", "My Computer", "My Music", "My Pictures", "My Video", "NetHood", "NetworkPlacesFolder",
                "OEM Links", "Original Images", "Personal", "PhotoAlbums", "Playlists", "PrintersFolder",
                "PrintHood", "Profile", "ProgramFiles", "ProgramFilesCommon", "ProgramFilesCommonX86",
                "ProgramFilesX86", "Programs", "Public", "PublicGameTasks", "Quick Launch", "Recent",
                "RecycleBinFolder", "ResourceDir", "SampleMusic", "SamplePictures", "SamplePlaylists",
                "SampleVideos", "SavedGames", "Searches", "SearchHomeFolder", "SendTo", "Start Menu",
                "Startup", "SyncCenterFolder", "SyncResultsFolder", "SyncSetupFolder", "System", "SystemCertificates",
                "SystemX86", "Templates", "TreePropertiesFolder", "UserProfiles", "UsersFilesFolder", "Windows"
            ];

            knownShells.forEach(cmd => {
                const li = document.createElement('li');
                const a = document.createElement('a');
                a.href = `shell:${cmd}`;
                a.textContent = `shell:${cmd}`;
                li.appendChild(a);
                list.appendChild(li);
                foundCount++;
            });

            const summary = document.createElement('p');
            summary.innerHTML = `<strong>共找到 ${foundCount} 个 Shell 命令。</strong><br>注意:部分命令在你的系统版本上可能无效。`;
            list.parentNode.insertBefore(summary, list);
        })();
    </script>
</body>
</html>

方法二:手动尝试

使用 shell:FolderName 的格式尝试常见名称,如 shell:OneDrive~、~shell:Screenshots 等。此方法不够全面。

相关手册与权威文档

微软官方文档(Microsoft Learn)

最权威的来源。搜索关键词:~Windows 命令 site:learn.microsoft.com~

内置 help 命令

在命令提示符(~cmd~)中:

  • 列出所有命令:~help~
  • 查看具体命令帮助:~help <命令名>~ 或 <命令名> /?

TechNet 库(旧版存档)

包含大量 shell: 命令的深入介绍。

PowerToys Command Palette

安装微软官方工具 PowerToys,使用其中的 Command Palette 快速搜索并运行 shell 命令。

注意事项

  1. **官方无完整列表**:微软未发布过官方版的“所有 shell: 命令大全”
  2. **版本差异**:不同 Windows 版本支持的 shell: 命令有差异
  3. **区分概念**:~shell:~ 命令与 cmd 中的命令行工具(如 ~ping~、~ipconfig~)是两个不同的概念
  4. **实践建议**:直接在运行对话框(<kbd>Win</kbd> + <kbd>R</kbd>)中输入测试,能打开即为有效

总结

shell: 命令是 Windows 系统管理的高效工具。掌握常用命令可以大幅提升操作效率。虽然没有官方完整列表,但通过本文提供的 HTML 脚本,你可以轻松获取当前系统支持的所有命令。

快速回顾

  • 打开运行:<kbd>Win</kbd> + <kbd>R</kbd>
  • 查看当前用户程序文件夹:~shell:programs~
  • 查看所有用户程序文件夹:~shell:common programs~
  • 获取完整列表:使用本文提供的 HTML 脚本

参考链接

什么是 Shell 命令

Windows 的 shell: 命令是一种特殊的快捷方式,用于直接访问系统文件夹。

使用方法

按下 <kbd>Win</br> + </kbd>R<kbd> 打开“运行”对话框,输入 shell:programs 后回车。

核心作用

快速访问 Windows 中的特定系统文件夹。

常用 Shell 命令列表

下表列出最常用的 shell: 命令及其作用。

命令 作用 范围
shell:Desktop 桌面 当前用户
shell:Downloads 下载文件夹 当前用户
shell:Personal 文档文件夹 当前用户
shell:My Music 我的音乐 当前用户
shell:My Pictures 我的图片 当前用户
shell:My Video 我的视频 当前用户
shell:Favorites 收藏夹 当前用户
shell:Recent 最近使用的项目 当前用户
shell:Startup 启动文件夹(开机自启) 当前用户
shell:Programs 开始菜单程序文件夹 当前用户
shell:SendTo 发送到菜单 当前用户
shell:AppData AppData/Roaming 当前用户
shell:Local AppData AppData/Local 当前用户
shell:Common Desktop 公用桌面 所有用户
shell:Common Programs 公用开始菜单程序文件夹 所有用户
shell:Common Startup 公用启动文件夹 所有用户
shell:Windows Windows 安装目录 系统
shell:System System32 文件夹 系统
shell:RecycleBinFolder 回收站 系统
shell:Fonts 字体文件夹 系统
shell:ControlPanelFolder 控制面板 系统
shell:PrintersFolder 打印机和设备 系统

实用示例:快速打开公用程序文件夹

场景

你想打开以下路径:

1
C:\ProgramData\Microsoft\Windows\Start Menu\Programs

解决方案

执行命令:

1
shell:common programs

shell:programs 的区别

命令 路径 作用范围 权限要求
shell:programs C:\Users\[用户名]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs 仅当前用户 普通用户
shell:common programs C:\ProgramData\Microsoft\Windows\Start Menu\Programs 所有用户 管理员权限

如何获取所有 Shell 命令

Windows 官方没有提供完整的 shell: 命令列表文档。以下是几种获取完整列表的方法。

方法一:使用 HTML 脚本自动提取

复制以下代码,保存为 shell_commands.html~,用浏览器打开即可获得当前系统支持的所有 ~shell: 命令列表(带可点击链接)。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html>
<head>
    <title>Windows Shell 命令列表</title>
    <meta charset="UTF-8">
</head>
<body>
    <h2>Windows Shell 命令列表 (点击链接即可打开)</h2>
    <ul id="cmdList"></ul>
    <script>
        (function() {
            const list = document.getElementById('cmdList');
            let foundCount = 0;

            const knownShells = [
                "AddNewProgramsFolder", "Administrative Tools", "AppData", "AppsFolder", "Cache",
                "CD Burning", "ChangeRemoveProgramsFolder", "Common Administrative Tools", "Common AppData",
                "Common Desktop", "Common Documents", "Common Programs", "Common Start Menu", "Common Startup",
                "CommonMusic", "CommonPictures", "CommonVideo", "ConflictFolder", "ConnectionsFolder", "Contacts",
                "ControlPanelFolder", "Cookies", "CredentialManager", "CryptoKeys", "CSCFolder", "Desktop",
                "Downloads", "DpapiKeys", "Favorites", "Fonts", "Games", "GameTasks", "Gadgets", "History",
                "InternetFolder", "Links", "Local AppData", "LocalAppDataLow", "LocalizedResourcesDir",
                "MAPIFolder", "My Computer", "My Music", "My Pictures", "My Video", "NetHood", "NetworkPlacesFolder",
                "OEM Links", "Original Images", "Personal", "PhotoAlbums", "Playlists", "PrintersFolder",
                "PrintHood", "Profile", "ProgramFiles", "ProgramFilesCommon", "ProgramFilesCommonX86",
                "ProgramFilesX86", "Programs", "Public", "PublicGameTasks", "Quick Launch", "Recent",
                "RecycleBinFolder", "ResourceDir", "SampleMusic", "SamplePictures", "SamplePlaylists",
                "SampleVideos", "SavedGames", "Searches", "SearchHomeFolder", "SendTo", "Start Menu",
                "Startup", "SyncCenterFolder", "SyncResultsFolder", "SyncSetupFolder", "System", "SystemCertificates",
                "SystemX86", "Templates", "TreePropertiesFolder", "UserProfiles", "UsersFilesFolder", "Windows"
            ];

            knownShells.forEach(cmd => {
                const li = document.createElement('li');
                const a = document.createElement('a');
                a.href = `shell:${cmd}`;
                a.textContent = `shell:${cmd}`;
                li.appendChild(a);
                list.appendChild(li);
                foundCount++;
            });

            const summary = document.createElement('p');
            summary.innerHTML = `<strong>共找到 ${foundCount} 个 Shell 命令。</strong><br>注意:部分命令在你的系统版本上可能无效。`;
            list.parentNode.insertBefore(summary, list);
        })();
    </script>
</body>
</html>

方法二:手动尝试

使用 shell:FolderName 的格式尝试常见名称,如 shell:OneDrive~、~shell:Screenshots 等。此方法不够全面。

相关手册与权威文档

微软官方文档(Microsoft Learn)

最权威的来源。搜索关键词:~Windows 命令 site:learn.microsoft.com~

内置 help 命令

在命令提示符(~cmd~)中:

  • 列出所有命令:~help~
  • 查看具体命令帮助:~help <命令名>~ 或 <命令名> /?

TechNet 库(旧版存档)

包含大量 shell: 命令的深入介绍。

PowerToys Command Palette

安装微软官方工具 PowerToys,使用其中的 Command Palette 快速搜索并运行 shell 命令。

注意事项

  1. **官方无完整列表**:微软未发布过官方版的“所有 shell: 命令大全”
  2. **版本差异**:不同 Windows 版本支持的 shell: 命令有差异
  3. **区分概念**:~shell:~ 命令与 cmd 中的命令行工具(如 ~ping~、~ipconfig~)是两个不同的概念
  4. **实践建议**:直接在运行对话框(<kbd>Win</kbd> + <kbd>R</kbd>)中输入测试,能打开即为有效

总结

shell: 命令是 Windows 系统管理的高效工具。掌握常用命令可以大幅提升操作效率。虽然没有官方完整列表,但通过本文提供的 HTML 脚本,你可以轻松获取当前系统支持的所有命令。

快速回顾

  • 打开运行:<kbd>Win</kbd> + <kbd>R</kbd>
  • 查看当前用户程序文件夹:~shell:programs~
  • 查看所有用户程序文件夹:~shell:common programs~
  • 获取完整列表:使用本文提供的 HTML 脚本
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计