LeeReamond
V2EX  ›  问与答

如何在不按住 shift 的情况下也能在 windows10 右键菜单中显示用 powershell 打开?

  •  
  •   LeeReamond · Apr 14, 2021 · 2087 views
    This topic created in 1947 days ago, the information mentioned may be changed or developed.

    如题,powershell 虽然拉胯,但不得不说 windows 平台上还是比一众第三方 shell 启动速度都快。

    我记得 windows 上通过修改注册表是可以实现右键直接打开,不用按 shift 的,但是忘记修改方法了,刚才百度搜了半天也没搜到信息,可能是关键字不对。v2 有没有老哥有相关改法的?

    18 replies    2021-04-15 16:34:21 +08:00
    Juicpt
        1
    Juicpt  
       Apr 14, 2021
    装一个 Windows Terminal ?
    Juicpt
        2
    Juicpt  
       Apr 14, 2021
    SuperMild
        3
    SuperMild  
       Apr 14, 2021
    装 Windows Terminal 吧,启动速度也是很快。
    Lunatic1
        4
    Lunatic1  
       Apr 14, 2021
    确实,按住 shift 确实麻烦
    Jirajine
        5
    Jirajine  
       Apr 14, 2021 via Android
    PowerShell 启动速度很糟糕,你觉得比其他的快是因为其他的那些不是 win 原生的程序。
    elvish 、nushell 等原生跨平台的 shell 启动都比 pwsh 快。
    ysc3839
        6
    ysc3839  
       Apr 14, 2021 via Android   ❤️ 1
    去注册表 HKEY_CLASSES_ROOT\Directory\Background\shell 下面看看吧,我现在没用电脑,不知道具体是哪个。
    LeeReamond
        7
    LeeReamond  
    OP
       Apr 14, 2021
    @Juicpt terminal 启动还是慢的,虽然确实挺好用的
    creanme
        8
    creanme  
       Apr 14, 2021
    HKEY_CLASSES_ROOT\Directory\Background\shell\Powershell 删掉 Extended
    limuyan44
        9
    limuyan44  
       Apr 14, 2021
    google 第一条
    open powershell without shift key
    abersheeran
        10
    abersheeran  
       Apr 14, 2021
    删掉对应注册表里的 Extended 就行了。PowerShell 、WSL 都一样。
    3dwelcome
        11
    3dwelcome  
       Apr 14, 2021
    我的注册表,参考一下:
    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]
    @="Open command window here"
    "Extended"=""
    "NoWorkingDirectory"=""

    [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere\command]
    @="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k, pushd,%V' -Verb RunAs\""


    话说你都能上 V2 正常发帖,用什么百度哦。
    ClericPy
        12
    ClericPy  
       Apr 14, 2021
    我也是手动在注册表里加的, 虽然加的是 cmder...
    azur
        13
    azur  
       Apr 14, 2021
    Windows Terminal
    LeeReamond
        14
    LeeReamond  
    OP
       Apr 15, 2021
    @3dwelcome 照着新建了个一样的,不好使,win10 20H2
    3dwelcome
        15
    3dwelcome  
       Apr 15, 2021
    @LeeReamond 我 win10 的版本比较老,可能和楼上回复综合一下,删掉"Extended"=""那句?
    LeeReamond
        16
    LeeReamond  
    OP
       Apr 15, 2021
    @LeeReamond 删除 extended 和 noworkingdirectory 后可以在右键菜单发现,但打开时提示

    [Window Title]Explorer.EXE

    [Content]
    该文件没有与之关联的应用来执行该操作。请安装应用,若已经安装应用,请在“默认应用设置”页面中创建关联。

    [确定]
    LeeReamond
        17
    LeeReamond  
    OP
       Apr 15, 2021
    @3dwelcome 感谢,解决了,后面的提示错误是命令错误导致的,不是注册表结构问题。注册表最后保留了 noworkingdirectory,删除了 extended
    PqgpNgA0wk
        18
    PqgpNgA0wk  
       Apr 15, 2021
    要不在资源管理器地址栏输 powershell 或 wt 🤣
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5400 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 01:37 · PVG 09:37 · LAX 18:37 · JFK 21:37
    ♥ Do have faith in what you're doing.