Sign in to follow this  
Followers 0
noaftschoarer

Windows Explorer Context Menu

8 posts in this topic

Hi Guys!

I'm just trying to call a context menu entry from the windows explorer. Purpose: Start a virus scan for a directory.

I was able to write a script for powershell

(if you are interested in it):

$o = new-object -com Shell.Application
$folder = $o.NameSpace("c:\temp")
$file=$folder.ParseName("test")
$file.Verbs() | %{ if($_.Name -eq ' ... name of the context menu entry ...') { $_.DoIt() } }

The problem: this script only supports context menu entries on "Level 1". It is not possible (or I did not find any solution) to adapt this script to perform with nested entries.

In my case the context menu entry is inside a folder:

"Norton Internet Security" > "Scan Now"

Does anybody have a solution for a problem like that? I want to avoid to solve this by sending keys. It would be possible, but it should run as stable as possible.

I am open for any kind of solution: Adaption of the power shell script, autoit, 3rd Party programs ...

 

Thanks a lot!

Share this post


Link to post
Share on other sites



Hi!

Thanks for your reply!

I cannot really figure out what you are meaning. The registry key allready exists (The virusscanner registered the entry while installation). That is no problem! I just dont know how to CALL the entry with a script. I want to imitate a 'click' on this entry.

Share this post


Link to post
Share on other sites

Is there an accelerator key in the context menu entry? For example if it was 'n' you would send n once the context menu was open. That would expand the submenu. Without that it's difficult because you won't know where to hover the mouse unless it only has to work on a specific machine.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I found out, that the context menu entry is pointing on a DLL of norton. This DLL contains the handler for the context menu.

As I mentioned, the powershell script allready works really fine, but only with context menu entries outside of any subfolder (highest level). In my opionion the best way to solve it is:

  • Adapt the script so it also works with entries in subfolders
  • OR Edit the entry of the contextmenu in the registry -> take the entry outside of the subfolder, so it works with the script.

Unfortunately I'm not able to solve one of the possible solutions :sweating:

Edited by noaftschoarer

Share this post


Link to post
Share on other sites

noaftschoarer, You should take a look at The Shell Context Menu. If you can see your context menu item in ListView.au3 (one of the examples, drag a folder to the ListView and right click) it should be possible to execute the menu item.

Share this post


Link to post
Share on other sites

i would ignore the context menu altogether, and instead i'd go and figure out how to give Norton the command directly, like described here:

https://support.norton.com/sp/en/us/home/current/solutions/v8278351_NIS_Retail_2012_en_us

extract from the link:

To run a scan from the command prompt
  1. At the command prompt, type the path in which Norton Internet Security is located and the executable's file name.

    The following examples show the syntax of a scan command:

    • "Program FilesNorton Internet SecurityEngineversionNAVW32" /command_name

      Where version represents the version number of Norton Internet Security and command_name represents the command.

    • "Program FilesNorton Internet SecurityEngineversionNAVW32" [path]file_name

      Where version represents the version number of Norton Internet Security and [path] file_name represents the location, name, and extension of the file.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0