Skip to content

Instantly share code, notes, and snippets.

@bjarkirafn
Last active November 12, 2020 19:09
Show Gist options
  • Save bjarkirafn/150beba0cc5cca7d415d930d0d97e88d to your computer and use it in GitHub Desktop.
Save bjarkirafn/150beba0cc5cca7d415d930d0d97e88d to your computer and use it in GitHub Desktop.
windows registry snippets

Cascaded Context Menu

  • how to
  • HKEY_CLASSES_ROOT\Directory\Background\shell
  1. Create a new key under the shell key.
  2. Name the key what you want the command to be shown as, for me it will be "Open Command Prompt"
  3. Right click the created key and add a new key called command(The sub key must be named command for it to work)
  4. Change the default value of the command key to the code that should be ran when the command is selected(ex: cmd.exe)

- userItentity:
root: &root HKCU:\SOFTWARE\Microsoft\IdentityCRL
paths:
MicrosoftUserName:
path: [*root, UserExtendedProperties]
code:
pwsh: [gci, *root, "|", select -ExpandProperty PSChildName]
MicrosoftUserUrl:
path: &microPath [*root, InterruptState]
code:
pwsh: [gp, *microPath]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment