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>
<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>