Skip to content

Instantly share code, notes, and snippets.

@jbsulli
Created May 16, 2017 02:38
Show Gist options
  • Save jbsulli/be2630b4e2d85987e0d77b3c457c1bc5 to your computer and use it in GitHub Desktop.
Save jbsulli/be2630b4e2d85987e0d77b3c457c1bc5 to your computer and use it in GitHub Desktop.
Add "Open with CMD" option to the Windows 10 context menu (both when right-clicking on a folder and in a folder).
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWithCMD]
@="Open with CMD"
"Icon"="C:\\WINDOWS\\system32\\cmd.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWithCMD\command]
@="cmd.exe /k cd %V"
[HKEY_CLASSES_ROOT\Directory\shell\OpenWithCMD]
@="Open with CMD"
"Icon"="C:\\WINDOWS\\system32\\cmd.exe"
[HKEY_CLASSES_ROOT\Directory\shell\OpenWithCMD\Command]
@="cmd.exe /k cd %1"
@SkyN9ne
Copy link

SkyN9ne commented Sep 6, 2023

For the "Icon" value I suggest you don't hard code the possibility variable path / drive like C:\ or D:\

%SystemRoot%\System32\cmd.exe is more flexible although even that is unnecessary. %ComSpec% alone is enough.

Also adding "open with cmd" to any file seems unreasonably dangerous... "open cmd here" feels more reasonable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment