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?

Était-ce utile?

La 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}"

Autres conseils

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top