soft

soft

win7 bat script


@echo off

@echo off
REM  https://www.nirsoft.net/utils/nircmd.html
start "" "D:\rszt\Reeiss\bin\Reeiss.exe"  

REM 打开 Reeiss.exe  

REM 等待程序启动
timeout /t 3 >nul

REM 移动窗口到 (0, 0)
tasklist /fi "imagename eq Reeiss.exe" | find ":" >nul && (
    for /f "tokens=2 delims=," %%a in ('tasklist /nh /fo csv /fi "imagename eq Reeiss.exe"') do (
        set pid=%%~a
    )
    for /f "tokens=1-4 skip=1" %%a in ('tasklist /fi "pid eq %pid%" /fo list') do (
        if "%%a"=="Window Title:" (
            set title=%%b
        )
    )
    nircmd win move title "%title%" 0 0
)

REM 等待3秒
timeout /t 3 >nul

REM 移动鼠标至 (100, 100) 并点击
tasklist /fi "imagename eq Reeiss.exe" | find ":" >nul && (
    for /f "tokens=2 delims=," %%a in ('tasklist /nh /fo csv /fi "imagename eq Reeiss.exe"') do (
        set pid=%%~a
    )
    for /f "tokens=1-4 skip=1" %%a in ('tasklist /fi "pid eq %pid%" /fo list') do (
        if "%%a"=="Window Title:" (
            set title=%%b
        )
    )
    nircmd win activate title "%title%"
    nircmd.exe movecursor 100 100
    nircmd.exe sendmouse left click
)





发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

联系我 331434376    15629529961