Skip to content

Instantly share code, notes, and snippets.

@keoy7am
Last active September 12, 2022 00:53
Show Gist options
  • Save keoy7am/dbf1337aa7436df06d0ae23f79e33554 to your computer and use it in GitHub Desktop.
Save keoy7am/dbf1337aa7436df06d0ae23f79e33554 to your computer and use it in GitHub Desktop.

找回Win10消失的命令提示元快捷

為了避免每次環境調整都要手動找一次
乾脆記錄在 gist

shift_cmd.reg

與PowerShell一樣在 Background\shell 下
原本的 命令提示元 替換成 PowerShell 後其機碼還是保留的
但需將 cmd 的 HideBasedOnVelocityId 改為 ShowBasedOnVelocityId
為了執行這動作會需要調整存取 regedit 權限
因此乾脆建一個腳本直接另外建立機碼

rightclick_cmd.reg

右鍵即可直接存取命令提示元

rightclick_cmd_administrator.reg

右鍵即可直接存取命令提示元(UAC)

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\cmd_here]
@="在這裡開啟 命令提示列 視窗"
"Icon"="cmd.exe"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\cmd_here\command]
@="\"C:\\Windows\\System32\\cmd.exe\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\cmd_here]
@="在這裡開啟 命令提示列 視窗"
"Icon"="cmd.exe"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\cmd_here\command]
@="\"C:\\Windows\\System32\\cmd.exe\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\cmdPrompt]
@="在這裡開啟 命令提示列 視窗"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\cmdPrompt\command]
@="\"C:\\Windows\\System32\\cmd.exe\" \"cd %1\""
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\shell\runas]
[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="在這裡開啟 命令提示列 視窗"
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""
[-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="在這裡開啟 命令提示列 視窗"
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""
[-HKEY_CLASSES_ROOT\Drive\shell\runas]
[HKEY_CLASSES_ROOT\Drive\shell\runas]
@="在這裡開啟 命令提示列 視窗"
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]
@="在這裡開啟 命令提示列 視窗"
"Icon"="cmd.exe"
"Extended"=""
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere\command]
@="cmd.exe -noexit -command Set-Location -literalPath '%V'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment