Hi I am new with batch file, I want to know how to auto press a key from batch file. I want to make a program that open a browser and press the tab key automatically.
Aacini
A search for "batch file sendkeys" and further revision returned this list of answers for similar questions:
- How to make a batch file to run a hotkey
- Batch file that changes URL in open browser
- Press Keyboard keys using a batch file
- Automatically respond to runas from batch file
The Batch file below do what you want:
@if (@CodeSection == @Batch) @then
@echo off
CScript //nologo //E:JScript "%~F0"
rem Open the browser here
goto :EOF
@end
WScript.CreateObject("WScript.Shell").SendKeys("{TAB}");
来源:https://stackoverflow.com/questions/25371406/how-to-press-a-key-with-batch-file