Question

I'm trying to get a VBScript to left/right click. I thought there might be a way to using the WshShell.SendKeys method, but it didn't include anything that would help me. How would I go about doing this?

Was it helpful?

Solution

This is a hack, but you can....

  1. right click
  2. then go down the menu
  3. then hit enter

Here it is :

Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys("+{F10}")
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys "{ENTER}"

OTHER TIPS

This Simulates a right click WshShell.SendKeys("+{F10}") I don't know how to simulate a left click though

WshShell.SendKeys("-{F10}") to simulate a left click

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top