Saul's blog Saul's blog
首页
后端
分布式
前端
更多
分类
标签
归档
友情链接
关于
GitHub (opens new window)

Saul.J.Wu

立身之本,不在高低。
首页
后端
分布式
前端
更多
分类
标签
归档
友情链接
关于
GitHub (opens new window)
  • 面试题

  • 博客搭建

  • 部署相关

  • 填坑

  • Python

  • 其他

    • Vagrant虚拟机快速搭建开发环境
    • Linux无法上网
    • yarn和npm命令对比
    • npm构建常用报错
    • windows右键打开终端
    • 微软输入法设置
    • 使用Navicat自动定期备份数据
    • Windows下用Chocolatey管理包工具
    • 右键新建markdown文件
    • 怎样开通gmail邮箱smtp服务
    • Typora+PicGo图床
    • vuepress主题升级
    • win10查看wifi密码
    • win10端口占用解决
    • SpringBoot开启热部署
    • VSCode Remote体验
  • 收藏夹

  • 友情链接
  • 更多
  • 其他
SaulJWu
2020-03-18

windows右键打开终端

如何让windows在任意位置下shift+右键打开终端?

经常打开cmd然后 不停地cd去到指定目录很烦,网上搜了这边东东,就把他记录下来,方便以后换设备使用。

任意一个位置新建一个记事本,保存为ANSI格式

Windows Registry Editor Version 5.00
 
; 若原先有,先删除原来的
[-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\PowershellAdmin]
 
; 1.右键:命令行
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]
@="在此处打开命令行窗口"
 
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere\command]
@="cmd.exe -noexit -command Set-Location -literalPath \"%V\"" 
 
; 2.右键:命令行(管理员)
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="在此处打开命令行窗口(管理员)"
"ShowBasedOnVelocityId"=dword:00639bc8
 
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""
 
; 3.shift+右键:Powershell(管理员)
[HKEY_CLASSES_ROOT\Directory\Background\shell\PowershellAdmin]
@="在此处打开 Powershell 窗口(管理员)"
"Extended"=""
 
[HKEY_CLASSES_ROOT\Directory\Background\shell\PowershellAdmin\command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -windowstyle hidden -Command $stpath = pwd; Start-Process PowerShell -ArgumentList \\\"-NoExit\\\", \\\"-Command Set-Location -literalPath '%V'\\\" -verb RunAs"
 
; 4.设置右键 管理员打开cmd的另一种方法(可用来替换上面的2)
; 通过Powershell调起,会闪过一次Powershell的窗口,去掉下面几行的[; ]可以取消注释
; [-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHereAdmin]
; 
; [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHereAdmin]
; @="在此处打开命令行窗口(管理员)"
; 
; [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHereAdmin\command]
; @="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k, pushd,%V' -Verb RunAs\""

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

1.另存为为.reg格式

2.双击运行,搞定!

帮我改善此页面 (opens new window)
#windows#终端
上次更新: 2021/02/16, 12:29:08
npm构建常用报错
微软输入法设置

← npm构建常用报错 微软输入法设置→

最近更新
01
zabbix学习笔记二
02-28
02
zabbix学习笔记一
02-10
03
Linux访问不了github
12-08
更多文章>
Theme by Vdoing | Copyright © 2020-2022 Saul.J.Wu | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式