tags:

views:

411

answers:

1

I want to automate simulation of a right click to open the context menu. Once the menu is open, select the selected action/shortcut available.

I know how to open:

WshShell.SendKeys("+{F10}");

Or using the AutoIt automation language (BASIC like):

  ;--on right click event
    MouseClick("right")
    $count = 1
    Do
        Send("{DOWN}")
        $count = $count + 1  

    Until $count > 7
    Send("{ENTER}")
    ;---select shortcut
    WinWaitActive("xxxxk")

    ;----doing execution from the 3rd program
    ControlSend("xxxxx",  "", "Edit2", "123ABC")
    Sleep(500)
    ControlSend("xxxxx",  "", "Edit3", "123ABC")
    Sleep(500)
    Send("{ENTER}")
    Sleep(500)

    WinClose("xxxxx")
    WinWaitActive("xxxxx", "Close")
    Send("{ENTER}")

Can I have something like this in VBScript? Too messy, I think.

A: 

Right click on what?

If you are talking about files/folders (in Windows Explorer), you can do it with shell automation: DoIt or InvokeVerb

Anders