rdp-cli
How to Automate Legacy Windows Applications Without an API
Why API automation fails with legacy Windows software
Automating legacy Windows applications without an API is possible, but ordinary API automation cannot solve it. Many accounting tools, ERP systems, warehouse programs and internal utilities expose no API, SDK or scripting interface. Their important workflows exist only behind buttons, forms, menus and pop-up dialogs.
The practical alternative is GUI Computer Use: an AI Agent connects to the real desktop through RDP or VNC, reads the current screen, performs one controlled action and checks the result.
A practical AI Agent + RDP/VNC workflow
With rdp-cli, the agent can connect to an existing RDP or VNC desktop and work with the application already installed there. Start with the quick start guide and save the returned session ID.
The reliable loop is:
- Capture the current screen.
- Locate the next field, button or dialog.
- Perform one small action.
- Capture the screen again.
- Confirm the actual result before continuing.
For example, an agent can inspect a remote Windows application:
rdp-cli screenshot --session SESSION --out before.png
rdp-cli click --session SESSION --desktop \
--x X --y Y --observation OBSERVATION
rdp-cli screenshot --session SESSION --out focused.png
rdp-cli type --session SESSION \
--text "Remote task completed." \
--observation NEW_OBSERVATION
rdp-cli screenshot --session SESSION --out after.png
The coordinates and observation values must come from the latest screenshot. A successful click command only means that input was dispatched; it does not prove that the application accepted the action.
Handle files and human review
A typical workflow might upload a spreadsheet to the remote workspace, open it in a legacy reporting tool, select a date range, export a PDF and download the finished file. RDP sessions can exchange files and folders when the server permits drive redirection. VNC is useful for controlling an existing desktop, but file transfer and other features depend on the protocol and server configuration.
When a dialog is unexpected or an approval is required, a person can watch the same session, pause agent input, take control in a native window or authorized browser, and hand the session back afterward. This keeps the automation useful without making high-risk decisions blindly.
Rules that prevent GUI automation failures
- Use small, verifiable actions instead of long click sequences.
- Take a fresh screenshot after important actions.
- Wait for loading screens and dialogs before continuing.
- Stop on unexpected login screens, warnings or errors.
- Keep passwords and API keys out of prompts and article content.
- Use a trusted network or VPN and grant only the access the task needs.
If a stable API exists, use it. GUI automation is most valuable when the application is graphical, old or impossible to integrate. It lets an AI Agent operate the Windows software people already depend on—without rebuilding that software first.
For setup details, see the rdp-cli RDP and VNC features.