Windows Terminal添加管理员cmd菜单

背景

windows terminal使用起来挺顺手,不过若进行需管理员权限的操作时,有点不太方便。可将其添加到菜单,方便使用。

步骤

1,安装gsudo

choco install gsudo

2,安装一个文本编辑器,例如vscode。如果已有,跳过此步。(windows terminal默认使用vscode作为其编辑器)

3,运行windows terminal,打开"设置"菜单,在配置settings.json文件中,添加如下第一个节点。然后重开windows terminal便可。

小贴士

windows terminal 启动后默认的页签是powershell。如果想让管理员cmd作为默认,可修改此配置文件为:"defaultProfile": "{41dd7a51-f0e1-4420-a2ec-1a7130b7e950}",//"{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",

"list": [
        {
          "guid": "{41dd7a51-f0e1-4420-a2ec-1a7130b7e950}",
          "name": "命令提示符(管理员)",
          "commandline": "gsudo.exe cmd.exe",
          "hidden": false
        },
        {
          // Make changes here to the powershell.exe profile.
          "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
          "name": "Windows PowerShell",
          "commandline": "powershell.exe",
          "hidden": false
        },
        {
          // Make changes here to the cmd.exe profile.
          "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
          "name": "命令提示符",
          "commandline": "cmd.exe",
          "hidden": false
        },
        {
          "guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
          "hidden": false,
          "name": "Ubuntu-20.04",
          "source": "Windows.Terminal.Wsl"
        },
        {
          "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
          "hidden": false,
          "name": "Ubuntu-18.04",
          "source": "Windows.Terminal.Wsl"
        },
        {
          "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
          "hidden": false,
          "name": "Azure Cloud Shell",
          "source": "Windows.Terminal.Azure"
        }

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值