Jump to content

Windows Explorer Context Menu


Recommended Posts

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!

Link to comment
Share on other sites

Hi noaftschoarer,

  Welcome to the Forums !

  You can add a registry key here for this

HKEY_LOCAL_MACHINESOFTWAREClasses*shellPathFinderCommand

I have a script that uses this in my sig called PathFinder.

Bill

Link to comment
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.

Link to comment
Share on other sites

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
Link to comment
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.

Link to comment
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.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...