从 Windows 服务中编写 GUI 脚本?

发布于 2024-07-14 13:40:41 字数 209 浏览 5 评论 0原文

我想自动化一个仅作为 GUI 应用程序附带的 Windows 应用程序(不支持命令行)。 AutoIt 的自动化本身相对简单。

然而,我想知道,是否可以通过 Windows 服务启动 Windows 应用程序(只需调用 AutoIt 脚本)?

I would like to automate a windows app that comes only with as a GUI app (no support for command-line). The automation itself is relatively straightforward with AutoIt.

Yet, I am wondering, is-it possible to launch the Windows App from with a windows service (that would simply call the AutoIt script)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

记忆消瘦 2024-07-21 13:40:41

即使 Auto-it 可以与 UAC 一起使用,您也很可能会遇到会话隔离问题 - 即服务和桌面不会混合并向彼此发送消息,除非明确编码以通过它。

所以这是可能的,但也不是小菜一碟。

您可能想查看: 启动 .从服务交互地使用 Net winforms 应用程序

Even if Auto-it can work with UAC, you will most likely run into Session Isolation troubles - i.e services and desktop don't mix and send messages to each other, unless explicitely coded to pass through it.

So it's possible, but it's not a piece of cake either.

You probably want to look at : Launching a .Net winforms application interactively from a service

倚栏听风 2024-07-21 13:40:41

虽然由于最新版本的 Windows 中与会话 0 隔离相关的复杂性而完全不建议这样做,但 AutoIt 脚本当然可以从 Windows 服务调用。 请参阅此页面,了解一些从 Windows 服务调用时按预期工作的示例脚本

但不幸的是,并非所有 AutoIt 函数似乎都能在会话 0 中工作。我们在“Win*”例程(WinActivate、WinExists)方面遇到了麻烦,因此您应该尽可能避免使用这些例程。 由于文档没有突出显示有问题的功能,因此请务必彻底测试!

While not at all advised because of complications associated with Session 0 isolation in the latest versions of Windows, AutoIt scripts can certainly be invoked from a Windows Service. Please see this page for a few sample scripts that work as expected when called from a Windows Service.

Unfortunately though, not all of the AutoIt functions seem to work in Session 0. We ran into trouble with the "Win*" routines (WinActivate, WinExists) so you should probably avoid those if you can. And since the documentation does not highlight the problematic functions be sure test thoroughly!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文