Windows Explorer with powershell RRS feed

  • General discussion

  • In this excellent blog Technet Blog you indicate that the arguments to the InvokeVerb method on a folderitem is the language neutral string found in the registry in various place.

    This MSDN article seems to contradict this because it says that the argument vVerb "It must be one of the values returned by the item's FolderItemVerb.Name property"  When I type:

    I get the following:
    Application Parent Name
    ----------- ------ ----
                       Edit with &Notepad++
                       Entrust &Encrypt File...
                       Entrust Digitally &Sign File...
                       Entrust Encrypt &and Digitally Sign File...
                       Open wit&h...
                       Scan for threats...
                       Always available o&ffline
                       Restore previous &versions
                       Create &shortcut

    This means that I should be able to do $folder.InvokeVerb("Entrust &Encrypt File...") but this does not work.  How would I find out what the string needs to be passed to invokeverb for this Entrust &Encrypt File.. name value.  Also, why does the MSDN article seem to contradict the blog?  Is this because we are talking about powershell and not jscript, vbscript or vb?

    Thanks for all the good work.

    • Changed type Bill_Stewart Tuesday, November 7, 2017 10:55 PM
    • Moved by Bill_Stewart Tuesday, November 7, 2017 10:55 PM Abandoned
    Thursday, October 5, 2017 3:35 PM

All replies

  • I would recommend not trying to script the shell verbs as those are intended for interactive use.

    Instead I would check whether there is a PowerShell cmdlet available or a command-line tool that you can use.

    -- Bill Stewart [Bill_Stewart]

    Thursday, October 5, 2017 4:03 PM
  • Invoke takes a verb object.  Get the object and pass it.

    Both articles are true.  The keys are help in the registry but we need to obtain them from the shell per object because the shell knows which ones are active when the object is accessed.

    Bill has good advice. Use the PS commands whenever possible.


    Thursday, October 5, 2017 4:10 PM