首页 > 解决方案 > 尝试运行 SENDKEYS 命令并得到:'"{TAB}"' 未被识别为内部或外部命令、程序或批处理文件

问题描述

这是我要运行的代码:

@if (@CodeSection == @Batch) @then

@echo off

for /F %%f in (spsip.txt) do (
    echo.
    echo Start Internet Explorer for: %%f?
    choice /m "Are you sure"
    
    if not errorlevel 2 (
    
    rem Use %SendKeys% to send keys to the keyboard buffer
    set SendKeys=C:\Windows\System32\cscript.exe //nologo //E:JScript "%~F0"
    START "" "http://%%f"
    rem the script only works if the application in question is the active window.
    timeout /t 10
    rem use the tab key to move the cursor to the login and password inputs. Most htmls
    rem %SendKeys% "{TAB}"
    rem now you can have it send the actual username/password to input box
    %SendKeys% "{TAB}"
    %SendKeys% "{TAB}"
    %SendKeys% "{TAB}"
    %SendKeys% "{TAB}"
    %SendKeys% "{TAB}"
    %SendKeys% "{TAB}"
    %SendKeys% "Admin"
    %SendKeys% "{TAB}"
    %SendKeys% "password"
    %SendKeys% "{ENTER}"

)

)

标签: windowsbatch-filesendkeys

解决方案


推荐阅读