CivArchive
    ← All articles
    Published March 13, 2025by NoneofYourBusiness2

    Mouseclick automation .bat file (Windows only)

    95 views0 reactions1 comments on CivitAI0 collected
    mouseclick.batwindowsautomationvideo generation guidebatch

    To run Comfy all night long works best by queue-ing one task at a time, which requires clicking.

    Make a new file, Mouseclick.txt, rename it to Mouseclick.bat and copy the text below into it.

    1. Adjust delay to any number of seconds that is relevant to your task.

    2. Save

    3. Run

    4. Leave mouse pointer where you want to click (Queue-button)

    5. Wake up in the morning to 100's of new videos

    *****

    @echo off

    title Left mouseclick script

    set "delay=400"

    echo This CMD window left-clicks where the mouse pointer is, every %delay% seconds.

    :LOOP

    powershell -Command "Add-Type -Name Win32 -Namespace User32 -MemberDefinition '[DllImport(\"user32.dll\")] public static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint cButtons, UIntPtr dwExtraInfo);'; [User32.Win32]::mouse_event(0x02,0,0,0,[UIntPtr]::Zero); [User32.Win32]::mouse_event(0x04,0,0,0,[UIntPtr]::Zero)"

    timeout /t %delay% >nul

    goto LOOP