Share via

Access context menu item from CLI

Thomas Bakker 1 Reputation point
2022-07-13T13:13:31.81+00:00

Hello all,

I'm looking for a way to access a specific context menu item from the CLI in Windows 10.

I have limited experience with registry items like the context menu and the way they interact with other Windows components.

In the perfect situation I would run a script which would access the given button and execute it using a file I determined earlier in the script.

I exported the registry item in text below:
Key Name: HKEY_CLASSES_ROOT*\shellex\ContextMenuHandlers{A9868662-7D07-4504-B679-EA985BXXXXXX}
Class Name: <NO CLASS>
Last Write Time: 14/06/2022 - 12:38
Value 0
Name: <NO NAME>
Type: REG_SZ
Data: PureRawContextMenu.ShellExtensionv2

Anyone who has done this or knows wether or not it's possible to be accessed outside the Windows context menu?
I know it's possible on other operating systems but I would like to make it work on my existing Windows 10 machine.

The best,
Thomas

Windows for business | Windows for IoT
Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. Aung Zaw Min Thwin 306 Reputation points
    2022-07-15T08:39:08.583+00:00

    Hi Thomas,

    You can try with PowerShell.

    Get-ChildItem -LiteralPath 'HKLM:\Software\Classes\*\shellex\ContextMenuHandlers'  
      
    #to get the Item properties...  
     Get-ItemProperty -LiteralPath 'HKLM:\Software\Classes\*\shellex\ContextMenuHandlers\{A9868662-7D07-4504-B679-EA985BXXXXXX}'  
      
      
    

    Pls note, we must use "-LiteralPath" since path has '*' in it.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.