How to press a key with batch file

前端 未结 1 1086
不思量自难忘°
不思量自难忘° 2020-12-11 06:19

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.

相关标签:
1条回答
  • 2020-12-11 06:53

    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}");
    
    0 讨论(0)
提交回复
热议问题