noaftschoarer Posted January 31, 2014 Posted January 31, 2014 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!
l3ill Posted January 31, 2014 Posted January 31, 2014 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 My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
noaftschoarer Posted February 1, 2014 Author Posted February 1, 2014 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.
l3ill Posted February 1, 2014 Posted February 1, 2014 I see, sorry misread the question. Is this what kind of file is Send Now? exe, msi, bat Most time you can start things with ShellExecute. My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
MilesAhead Posted February 1, 2014 Posted February 1, 2014 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. My Freeware Page
noaftschoarer Posted February 1, 2014 Author Posted February 1, 2014 (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 Edited February 1, 2014 by noaftschoarer
LarsJ Posted February 1, 2014 Posted February 1, 2014 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. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions
orbs Posted February 1, 2014 Posted February 1, 2014 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 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now