• Windows 通过注册表添加:鼠标右键文件夹内空白处,提示打开 Cmd、Powershell


    1. 目标

    平台:Windows 10

    实现右键文件夹内空白处,提示 ”在此打开 cmd’、“在此打开 Powershell”:


    2. 添加 “在此打开 cmd” 步骤

    1. Win + R 打开运行窗口,输入 regedit,打开注册表窗口
      在这里插入图片描述

    2. 打开 计算机\HKEY_CLASSES_ROOT\Directory\Background\shell
      在这里插入图片描述

    3. 在 shell 下右键 > 新建项,命名为 open_cmd > 设值为 在此打开 cmd
      在这里插入图片描述

    4. 在 shell 下右键 > 新建 > 字符串 Icon > 双击或右键编辑,赋值为 cmd 窗口的路径

      • 查看 cmd 窗口路径:打开 cmd 文件路径
        在这里插入图片描述
        右键命令提示符打开目标: 在这里插入图片描述
        打开后可以得到 cmd.exe 路径:
        在这里插入图片描述
    • 综上所述,cmd.exe 文件路径为: C:\Windows\system32\cmd.exe

    • 所用的 Icon 的值可以设为 cmd.exe 路径值

      所以设置 Icon 的值为:
      在这里插入图片描述

    1. open_cmd 下右键 > 新建项,命名为 command,设值为 cmd.exe 路径
      在这里插入图片描述

    2. 在任意文件夹空白处测试:
      在这里插入图片描述

    能够正常打开:
    在这里插入图片描述


    3. 添加 “在此打开 powershell” 步骤

    • 步骤与添加 “在此打开 cmd” 类似
    1. Win + R 打开运行窗口,输入 regedit,打开注册表窗口
      在这里插入图片描述

    2. 打开 计算机\HKEY_CLASSES_ROOT\Directory\Background\shell
      在这里插入图片描述

    3. 右键点击 shell > 新建项,命名为 open_powershell,设置为 “在此打开 PowerShell”:
      在这里插入图片描述

    4. 右键点击 open_powershell > 新建字符串,命名为 Icon > 设值为 powershell.exe 的路径:

      • 查看 powershell.exe 路径
        在这里插入图片描述
        在这里插入图片描述
        在这里插入图片描述
        综上所述,powershell.exe 的路径为:C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
    • Icon 路径为:
      在这里插入图片描述
    1. 右键点击 open_powershell > 新建项,命名为 command > 设值为 powershell.exe 路径
      在这里插入图片描述
    2. 测试一下
    • 右键某文件夹内空白处
      在这里插入图片描述
    • 能够正常打开
      在这里插入图片描述
  • 相关阅读:
    <sa8650>QCX Camera ISP overview
    Moleculer微服务02
    调用链路上千条,如何观测 Nacos 的运行状态
    Go源码实现使用多线程并发下载大文件的功能
    C#基础学习(二十三)_窗体与事件
    xargs 命令详解
    Python 概念集合浅谈
    SuperMap GIS管线数据优化
    JRebel
    java开发环境安装-202209
  • 原文地址:https://blog.csdn.net/qq_36804363/article/details/126842388