Sign in to follow this  
Followers 0
Swarles

Controlling Windows Application by Autoit as a Service

3 posts in this topic

Hey guys,

I hope you can help me. I am currently working on an Autoit-Tool which shall control Microsoft ICE on a server. When I started the Autoit-Script manually it already worked perfect. Now I used AlwaysUp to create a Windows Service of the script and have some problems to control Microsoft ICE.

I start Microsoft ICE and check if it is fully loaded with:

Opt("WinTitleMatchMode", 3)

WinWait("temp - Microsoft Image Composite Editor")
If WinExists ("temp - Microsoft Image Composite Editor")
(...)

This works, but my first problem was, that I was looking up some controls with _ImageSearch, which didn't work anymore, when started as a service. So I tried to use Tabulator to get to the correct control with:

WinSetState("temp - Microsoft Image Composite Editor", "", @SW_SHOW)
WinActivate("temp - Microsoft Image Composite Editor")
Send("{TAB}")
(...)

Which again worked perfectly when I started it as a normal program, but not as a service. So my last try was with:

ControlSend ("temp - Microsoft Image Composite Editor","","","{TAB}")

Which also worked as a normal program, but not as a service. Do you have any ideas how I can get my script to work when running it as a service?

Thanks, Swarles

Share this post


Link to post
Share on other sites



didn't find a edit button:

The script is running on a Windows 2008 Server.

Share this post


Link to post
Share on other sites

I know Scheduled Tasks have a button called "Run Only When User is logged in", and this is necessary if you want the task to have any user interactions. I'm not sure if Services have that option. It may be that you need some indirection, e.g. run something as a service, which checks whether there is a console session, and if so, start an on-demand Scheduled Task to run a gui.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0