Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

Trying to script tabbing through fields

$
0
0
I have been at this for a while. It has been a while since I've used scripting languages, but trying to do one in VBscript and saving as a Windows Scripting File. I am basically trying to open a program (wireguard.exe) and tab through to the "Activate" button, where I want it to do the equivalent of hitting space bar to initiate the button. There is no switches or better ways I've found to start the program automatically. Here is what I have so far. Any assistance is much appreciated.

<package>
<job id="vbs">
<script language="VBScript">
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "wireguard"
WScript.Sleep 100
WshShell.AppActivate "wireguard"
WScript.Sleep 100
WshShell.SendKeys " "
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys " "
WScript.Sleep 500
</script>
</job>
</package>

Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>