Jump to content
Sign in to follow this  

How to automate rightclick and select menu item on one of the list view item?

Recommended Posts


I want to automate right click operation on one of the items of listview control and select a menu item.

In particular, I have opened printer & faxes and I want to right click on one printer driver and select properties of that printer driver.

Does any one know how to do last part? ie selecting a menu item?

Thanks in advance


Share this post

Link to post
Share on other sites

There's a few ways to do it. You can emulate mouse clicks/keystrokes, or you can script it using a shell object.

$shell = ObjCreate("Shell.Application")
$folder = $shell.NameSpace(4)

For $objItem in $folder.Items
    For $verb in $objItem.verbs
        If $verb.Name = "P&roperties" Then
            $ans = msgbox(4,"Configure Printer" ,"Open Properties for " & @CRLF & $objItem.Name)
            If $ans = 6 Then 
                While WinExists($objItem.name)

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.