Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have a batfile that uses a vbs. i need that for running a homepage automatically. i am working also on a loop.

What I have tried:

c:
cd C:\Tor Browser\Browser
start firefox.exe
timeout 12
start "" cmd /c cscript program.vbs
timeout 7
exit



WshShell.SendKeys "{TAB 12}"
WshShell.SendKeys "{ENTER}"
Posted
Updated 10-Apr-20 0:17am
v3

 
Share this answer
 
If you would like to send [TAB] key 12 times, you have to use a loop!
For example:
vbs
Dim counter
counter = 1
Do While counter <= 12
    WshShell.SendKeys "{TAB}"
    counter = counter + 1
Loop


See: VBScript Looping with VBScript[^]
 
Share this answer
 
v2
Quote:
How do I create a vbs, that presses 12 times "tab" and after that "enter"?

If your problem is making a loop in vbs, the most simple solution is to not use 1.
VB
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{ENTER}"
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900