Does Verbs() support Submenus

Welcome Forums General PowerShell Q&A Does Verbs() support Submenus

Viewing 2 reply threads
  • Author
    Posts
    • #240575
      Participant
      Topics: 1
      Replies: 1
      Points: 17
      Rank: Member

      I have written a small piece of code which displays context menu forĀ  Devices&Printers. This does not work for menu items, which have submenus.

      $o = new-object -com Shell.Application
      $folder = $o.NameSpace(“shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}”)
      foreach ($item in $folder.Items())
      {
      If ($item.Name -eq ‘iCR6X–1613950’)
      {

      # below does not print menu items which have submenu
      $item.Verbs()
      }
      }

       

      Any help is appreciated.

      Rohan

    • #240662
      Participant
      Topics: 9
      Replies: 707
      Points: 2,848
      Helping Hand
      Rank: Community Hero

      Both of these show the items I’d expect. They are not blank. Not sure why they would be blank for you?

      Some of the output

    • #240734
      Participant
      Topics: 1
      Replies: 1
      Points: 17
      Rank: Member

      Thanks for the reply.

      You can easily reproduce this by using the below powershell script(https://devblogs.microsoft.com/scripting/use-powershell-to-work-with-windows-explorer/), which also does not display menu containing submenus.

      $o = new-object -com Shell.Application
      $folder = $o.NameSpace(“C:\Windows\System32”)
      $file=$folder.ParseName(“notepad.exe”)
      $file.Verbs()|select Name

       

       

Viewing 2 reply threads
  • The topic ‘Does Verbs() support Submenus’ is closed to new replies.